diff options
author | José Valim <jose.valim@gmail.com> | 2011-12-08 20:59:43 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-12-08 21:00:34 +0100 |
commit | ebd71fd0e39abf495bdf64e3e6d278340c17e5ea (patch) | |
tree | cc770d6fe1f79c77bdd64134bf672ab5d56cf2b6 /actionpack/lib | |
parent | 94dcbe8115810b4545ca8011e6c1e5386cb1c842 (diff) | |
download | rails-ebd71fd0e39abf495bdf64e3e6d278340c17e5ea.tar.gz rails-ebd71fd0e39abf495bdf64e3e6d278340c17e5ea.tar.bz2 rails-ebd71fd0e39abf495bdf64e3e6d278340c17e5ea.zip |
Fix a regression and also fix broken test.
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/renderer/template_renderer.rb | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/actionpack/lib/action_view/renderer/template_renderer.rb b/actionpack/lib/action_view/renderer/template_renderer.rb index 6bf91de05a..1771fb0063 100644 --- a/actionpack/lib/action_view/renderer/template_renderer.rb +++ b/actionpack/lib/action_view/renderer/template_renderer.rb @@ -64,10 +64,15 @@ module ActionView def resolve_layout(layout, keys) case layout when String - if layout =~ /^\// - with_fallbacks { find_template(layout, nil, false, keys, @details) } - else - find_template(layout, nil, false, keys, @details) + begin + if layout =~ /^\// + with_fallbacks { find_template(layout, nil, false, keys, @details) } + else + find_template(layout, nil, false, keys, @details) + end + rescue ActionView::MissingTemplate + all_details = @details.merge(:formats => @lookup_context.default_formats) + raise unless template_exists?(layout, nil, false, keys, all_details) end when Proc resolve_layout(layout.call, keys) |