instance method
with_layout_format
Ruby on Rails 3.0.20
Since v3.0.20 Last seen in v3.1.12Available in: v3.0.20 v3.1.12
Signature
with_layout_format()
A method which only uses the first format in the formats array for layout lookup. This method plays straight with instance variables for performance reasons.
Source
# File actionpack/lib/action_view/lookup_context.rb, line 183
def with_layout_format
if formats.size == 1
yield
else
old_formats = formats
_set_detail(:formats, formats[0,1])
begin
yield
ensure
_set_detail(:formats, old_formats)
end
end
end
Defined in actionpack/lib/action_view/lookup_context.rb line 183
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionView::LookupContext::Details