Module: Merb::RenderMixin::ClassMethods

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

Instance Method Summary collapse

Instance Method Details

#default_layoutObject

Enable the default layout logic - reset the layout option.



48
49
50
# File 'lib/merb-core/controller/mixins/render.rb', line 48

def default_layout
  self.default_render_options.delete(:layout)
end

#default_render_optionsObject

Return the default render options.

Returns

Hash

An options hash



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

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.



43
44
45
# File 'lib/merb-core/controller/mixins/render.rb', line 43

def layout(layout)
  self.default_render_options.update(:layout => (layout ? layout : false))
end

#render_options(opts) ⇒ Object

Set default render options at the class level.

Parameters

opts<Hash>

An options hash



28
29
30
# File 'lib/merb-core/controller/mixins/render.rb', line 28

def render_options(opts)
  self._default_render_options = opts
end