instance method _layout_for_option

Ruby on Rails 5.2.8.1

Since v4.1.16 Private

Available in: v4.1.16 v4.2.9 v5.2.8.1 v6.0.6 v6.1.7.10 v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

_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

name req
Source
# File actionview/lib/action_view/layouts.rb, line 387
    def _layout_for_option(name)
      case name
      when String     then _normalize_layout(name)
      when Proc       then name
      when true       then Proc.new { |formats| _default_layout(formats, true)  }
      when :default   then Proc.new { |formats| _default_layout(formats, 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 387 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActionView::Layouts

Type at least 2 characters to search.

↑↓ navigate · open · esc close