Module: Merb::RenderMixin::ClassMethods

Defined in:
lib/merb-core/controller/mixins/render.rb

Instance Method Summary collapse

Instance Method Details

#_templates_forObject


18
19
20
# File 'lib/merb-core/controller/mixins/render.rb', line 18

def _templates_for
  @_templates_for ||= {}
end

#default_layoutObject

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.default_render_options.delete(:layout)
end

#default_render_optionsObject

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 default_render_options
  self._default_render_options ||= {}
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.default_render_options.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 render_options(opts)
  self._default_render_options = opts
end