Class: Mack::Rendering::Type::Inline
- Defined in:
- lib/mack/rendering/type/inline.rb
Overview
This class allows for a template to be rendered inline in a controller, and not served from disk.
Examples:
<%= render(:inline, "<%= 2 + 2 %> should equal 4") %> # => "4 should equal 4"
<%= render(:inline, "xml.hello("Mark")", :engine => :builder) %> # => "<hello>Mark</hello>"
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#concat(txt, b) ⇒ Object
Passes concatenation messages through to the Mack::Rendering::Engine object.
- #render ⇒ Object
Methods inherited from Base
#allow_layout?, #capture, #controller_view_path, #find_engine, #find_file, #initialize, #method_missing
Constructor Details
This class inherits a constructor from Mack::Rendering::Type::Base
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Mack::Rendering::Type::Base
Instance Method Details
#concat(txt, b) ⇒ Object
Passes concatenation messages through to the Mack::Rendering::Engine object. This should append the text, using the passed in binding, to the final output of the render.
20 21 22 |
# File 'lib/mack/rendering/type/inline.rb', line 20 def concat(txt, b) @engine.concat(txt, b) end |
#render ⇒ Object
12 13 14 15 |
# File 'lib/mack/rendering/type/inline.rb', line 12 def render @engine = find_engine((self.[:engine] || :erubis)).new(self.view_template) return @engine.render(self._render_value, self._binder) end |