diff options
author | José Valim <jose.valim@gmail.com> | 2010-03-08 16:32:40 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-03-08 16:32:40 +0100 |
commit | 68cda695da27f57cae682d160a13dab4dacb1ef8 (patch) | |
tree | 3a3aedb66bc64e4e70220b3f051cd71356373226 /actionpack/lib/action_view/render/layouts.rb | |
parent | 44ebab96da0ab47cc45c64a6efdd2cbb80f9d042 (diff) | |
download | rails-68cda695da27f57cae682d160a13dab4dacb1ef8.tar.gz rails-68cda695da27f57cae682d160a13dab4dacb1ef8.tar.bz2 rails-68cda695da27f57cae682d160a13dab4dacb1ef8.zip |
Speed up performance in resolvers by adding fallbacks just when required.
Diffstat (limited to 'actionpack/lib/action_view/render/layouts.rb')
-rw-r--r-- | actionpack/lib/action_view/render/layouts.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/render/layouts.rb b/actionpack/lib/action_view/render/layouts.rb index b9c63e0090..91a92a833a 100644 --- a/actionpack/lib/action_view/render/layouts.rb +++ b/actionpack/lib/action_view/render/layouts.rb @@ -48,7 +48,8 @@ module ActionView # the given name exists across all details before raising the error. def _find_layout(layout) #:nodoc: begin - find_template(layout) + layout =~ /^\// ? + with_fallbacks { find_template(layout) } : find_template(layout) rescue ActionView::MissingTemplate => e update_details(:formats => nil) do raise unless template_exists?(layout) |