diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2012-02-21 23:55:56 -0200 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2012-02-22 11:13:02 -0200 |
commit | 19433ce8701d9ff2b311d0a2ec98be366ce461ea (patch) | |
tree | a2acdc41ab925c64d98b7944b3ff2d3928bb2412 /actionpack/lib/action_view/template.rb | |
parent | 35626feb61e260ec704ed407768da4c6a2f27a47 (diff) | |
download | rails-19433ce8701d9ff2b311d0a2ec98be366ce461ea.tar.gz rails-19433ce8701d9ff2b311d0a2ec98be366ce461ea.tar.bz2 rails-19433ce8701d9ff2b311d0a2ec98be366ce461ea.zip |
format lookup for partials is derived from the format in which the template is being rendered
Closes #5025 part 2
Diffstat (limited to 'actionpack/lib/action_view/template.rb')
-rw-r--r-- | actionpack/lib/action_view/template.rb | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/actionpack/lib/action_view/template.rb b/actionpack/lib/action_view/template.rb index ebb8e5c1a6..eac6287b0b 100644 --- a/actionpack/lib/action_view/template.rb +++ b/actionpack/lib/action_view/template.rb @@ -160,17 +160,12 @@ module ActionView # virtual path set (true just for inline templates). def refresh(view) raise "A template needs to have a virtual path in order to be refreshed" unless @virtual_path - begin - lookup = view.lookup_context - pieces = @virtual_path.split("/") - name = pieces.pop - partial = !!name.sub!(/^_/, "") - previous_formats, lookup.formats = lookup.formats, @formats - lookup.disable_cache do - lookup.find_template(name, [ pieces.join('/') ], partial, @locals) - end - ensure - lookup.formats = previous_formats + lookup = view.lookup_context + pieces = @virtual_path.split("/") + name = pieces.pop + partial = !!name.sub!(/^_/, "") + lookup.disable_cache do + lookup.find_template(name, [ pieces.join('/') ], partial, @locals) end end |