instance method find_layout

Ruby on Rails 3.0.20

Since v3.0.20 Last seen in v3.0.20

Signature

find_layout(layout)

This is the method which actually finds the layout using details in the lookup context object. If no layout is found, it checks if at least a layout with the given name exists across all details before raising the error.

Parameters

layout req
Source
# File actionpack/lib/action_view/render/layouts.rb, line 65
    def find_layout(layout)
      begin
        with_layout_format do
          layout =~ /^\// ?
            with_fallbacks { find_template(layout) } : find_template(layout)
        end
      rescue ActionView::MissingTemplate => e
        update_details(:formats => nil) do
          raise unless template_exists?(layout)
        end
      end
    end

Defined in actionpack/lib/action_view/render/layouts.rb line 65 · 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