instance method
action_has_layout?
Ruby on Rails 3.1.12
Since v3.0.20 Last seen in v3.1.12Available in: v3.0.20 v3.1.12
Signature
action_has_layout?()
Determines whether the current action has a layout by checking the action name against the :only and :except conditions set on the layout.
Returns
-
Boolean- True if the action has a layout, false otherwise.
Source
# File actionpack/lib/abstract_controller/layouts.rb, line 191
def action_has_layout?
return unless super
conditions = _layout_conditions
if only = conditions[:only]
only.include?(action_name)
elsif except = conditions[:except]
!except.include?(action_name)
else
true
end
end
Defined in actionpack/lib/abstract_controller/layouts.rb line 191
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in AbstractController::Layouts::ClassMethods::LayoutConditions