instance method
_layout_for_option
Ruby on Rails 8.0.4
Since v4.1.16 PrivateSignature
_layout_for_option(name)
Determine the layout for a given name, taking into account the name type.
Parameters
-
name- The name of the template
Parameters
-
namereq
Source
# File actionview/lib/action_view/layouts.rb, line 388
def _layout_for_option(name)
case name
when String then _normalize_layout(name)
when Proc then name
when true then Proc.new { |lookup_context, formats, keys| _default_layout(lookup_context, formats, keys, true) }
when :default then Proc.new { |lookup_context, formats, keys| _default_layout(lookup_context, formats, keys, false) }
when false, nil then nil
else
raise ArgumentError,
"String, Proc, :default, true, or false, expected for `layout'; you passed #{name.inspect}"
end
end
Defined in actionview/lib/action_view/layouts.rb line 388
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionView::Layouts