diff options
author | Xavier Noria <fxn@hashref.com> | 2010-06-07 15:44:57 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2010-06-07 15:44:57 +0200 |
commit | 9e065c6bc175621ad30a416c8c4345f95ce3c264 (patch) | |
tree | 505df4243727a00d1f030205f2e64afe0d098e5e /actionpack/lib/action_view/render/layouts.rb | |
parent | 0dbc732995a526354fb1e3c732af5dacdb863dda (diff) | |
parent | 1a8f784a236058101c6e8b6387aefc96e86a1e54 (diff) | |
download | rails-9e065c6bc175621ad30a416c8c4345f95ce3c264.tar.gz rails-9e065c6bc175621ad30a416c8c4345f95ce3c264.tar.bz2 rails-9e065c6bc175621ad30a416c8c4345f95ce3c264.zip |
Merge remote branch 'rails/master'
Diffstat (limited to 'actionpack/lib/action_view/render/layouts.rb')
-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) } |