diff options
Diffstat (limited to 'actionpack/lib/action_view/render')
-rw-r--r-- | actionpack/lib/action_view/render/layouts.rb | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/actionpack/lib/action_view/render/layouts.rb b/actionpack/lib/action_view/render/layouts.rb index 31b09d9f0a..a9dfc0cced 100644 --- a/actionpack/lib/action_view/render/layouts.rb +++ b/actionpack/lib/action_view/render/layouts.rb @@ -57,15 +57,11 @@ module ActionView # This is the method which actually finds the layout using details in the lookup # context object. If no layout is found, it checkes if at least a layout with # the given name exists across all details before raising the error. - # - # If self.formats contains several formats, just the first one is considered in - # the layout lookup. def find_layout(layout) begin - if formats.size == 1 - _find_layout(layout) - else - update_details(:formats => self.formats.first){ _find_layout(layout) } + with_layout_format do + layout =~ /^\// ? + with_fallbacks { find_template(layout) } : find_template(layout) end rescue ActionView::MissingTemplate => e update_details(:formats => nil) do @@ -74,11 +70,6 @@ module ActionView end end - def _find_layout(layout) #:nodoc: - layout =~ /^\// ? - with_fallbacks { find_template(layout) } : find_template(layout) - end - # Contains the logic that actually renders the layout. def _render_layout(layout, locals, &block) #:nodoc: layout.render(self, locals){ |*name| _layout_for(*name, &block) } |