instance method conditional_layout?

Ruby on Rails 3.2.22.5

Since v3.2.22.5 Last seen in v3.2.22.5

Signature

conditional_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 221
        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

Defined in actionpack/lib/abstract_controller/layouts.rb line 221 · View on GitHub · Improve this page · Find usages on GitHub

Defined in AbstractController::Layouts::ClassMethods::LayoutConditions

Type at least 2 characters to search.

↑↓ navigate · open · esc close