From 4eff6bc6dfeea3eed5d92af66bd73e6a2cb9b09f Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Tue, 21 Feb 2012 14:55:34 -0200 Subject: Restore lookup formats to the previous value after searching for the failing view --- actionpack/lib/action_view/template.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_view/template.rb b/actionpack/lib/action_view/template.rb index af6e5d0645..3a944cf1ab 100644 --- a/actionpack/lib/action_view/template.rb +++ b/actionpack/lib/action_view/template.rb @@ -164,10 +164,12 @@ module ActionView pieces = @virtual_path.split("/") name = pieces.pop partial = !!name.sub!(/^_/, "") - lookup.formats = @formats + 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 end def inspect -- cgit v1.2.3