# File actionview/lib/action_view/layouts.rb, line 266
def layout(layout, conditions = {})
include LayoutConditions unless conditions.empty?
conditions.each { |k, v| conditions[k] = Array(v).map(&:to_s) }
self._layout_conditions = conditions
self._layout = layout
_write_layout_method
end Specify the layout to use for this class.
If the specified layout is a:
String the String is the template name
Symbol call the method specified by the symbol
call the passed Proc
There is no layout
raise an ArgumentError
Force default layout behavior with inheritance
Return value of Proc and Symbol arguments should be String, false, true or nil with the same meaning as described above.
layout - The layout to use.
:only - A list of actions to apply this layout to.
:except - Apply this layout to all actions but this one.
© 2004–2021 David Heinemeier Hansson
Licensed under the MIT License.