instance method _default_layout

Ruby on Rails 3.0.20

Since v3.0.20 Last seen in v4.0.13 Private

Available in: v3.0.20 v3.1.12 v3.2.22.5 v4.0.13

Signature

_default_layout(require_layout = false)

Returns the default layout for this controller and a given set of details. Optionally raises an exception if the layout could not be found.

Parameters

  • details - A list of details to restrict the search by. This might include details like the format or locale of the template.

  • require_logout - If this is true, raise an ArgumentError with details about the fact that the exception could not be found (defaults to false)

Returns

  • template - The template object for the default layout (or nil)

Parameters

require_layout opt = false
Source
# File actionpack/lib/abstract_controller/layouts.rb, line 343
    def _default_layout(require_layout = false)
      begin
        layout_name = _layout if action_has_layout?
      rescue NameError => e
        raise NoMethodError,
          "You specified #{@_layout.inspect} as the layout, but no such method was found"
      end

      if require_layout && action_has_layout? && !layout_name
        raise ArgumentError,
          "There was no default layout for #{self.class} in #{view_paths.inspect}"
      end

      layout_name
    end

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

Defined in AbstractController::Layouts

Type at least 2 characters to search.

↑↓ navigate · open · esc close