Module: Merb::RenderMixin::ClassMethods
- Defined in:
- lib/merb-core/controller/mixins/render.rb
Instance Method Summary collapse
- #_templates_for ⇒ Object
-
#default_layout ⇒ Object
Enable the default layout logic - reset the layout option.
-
#default_render_options ⇒ Object
Return the default render options.
-
#layout(layout) ⇒ Object
Set the default layout to use or nil/false to disable layout rendering.
-
#render_options(opts) ⇒ Object
Set default render options at the class level.
Instance Method Details
#_templates_for ⇒ Object
18 19 20 |
# File 'lib/merb-core/controller/mixins/render.rb', line 18 def _templates_for @_templates_for ||= {} end |
#default_layout ⇒ Object
Enable the default layout logic - reset the layout option.
Returns
- ~to_s
-
The layout that was previously set.
:api: public
65 66 67 |
# File 'lib/merb-core/controller/mixins/render.rb', line 65 def default_layout self..delete(:layout) end |
#default_render_options ⇒ Object
Return the default render options.
Returns
- Hash
-
An options hash
:api: public
28 29 30 |
# File 'lib/merb-core/controller/mixins/render.rb', line 28 def self. ||= {} end |
#layout(layout) ⇒ Object
Set the default layout to use or nil/false to disable layout rendering. This is a shortcut for render_options :layout => false.
Parameters
- layout<~to_s>
-
The layout that should be used for this class.
Notes
You can override by passing :layout => true to render method.
Returns
- Hash
-
The default render options.
:api: public
55 56 57 |
# File 'lib/merb-core/controller/mixins/render.rb', line 55 def layout(layout) self..update(:layout => (layout || false)) end |
#render_options(opts) ⇒ Object
Set default render options at the class level.
Parameters
- opts<Hash>
-
An options hash
:api: public
38 39 40 |
# File 'lib/merb-core/controller/mixins/render.rb', line 38 def (opts) self. = opts end |