aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/new_base/layouts.rb
blob: cdf2224e3996aec8bb4ce06553c1bb185e4637a2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
module ActionController
  module Layouts
    def render_to_string(options)
      options[:_layout] = options[:layout] || _layout
      super
    end
    
    def _layout
      begin
        view_paths.find_by_parts(controller_path, formats, "layouts")
      rescue ActionView::MissingTemplate
        begin
          view_paths.find_by_parts("application", formats, "layouts")
        rescue ActionView::MissingTemplate
        end
      end
    end
  end
end