123456789_123456789_123456789_123456789_123456789_

Module: ActionView::Layouts::ClassMethods::LayoutConditions

Do not use. This module is for internal use only.
Relationships & Source Files
Defined in: actionview/lib/action_view/layouts.rb

Overview

This module is mixed in if layout conditions are provided. This means that if no layout conditions are used, this method is not used

Instance Attribute Summary

  • #_conditional_layout? ⇒ Boolean readonly private

    Determines whether the current action has a layout definition by checking the action name against the :only and :except conditions set by the #layout method.

Instance Attribute Details

#_conditional_layout?Boolean (readonly, private)

Determines whether the current action has a layout definition by checking the action name against the :only and :except conditions set by the ActionView::Layouts::ClassMethods#layout method.

Returns

  • Boolean - True if the action has a layout definition, false otherwise.

[ GitHub ]

  
# File 'actionview/lib/action_view/layouts.rb', line 235

def _conditional_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