Skip to content

Commit 091df3a

Browse files
committed
Fix Rails 3.2 compatibility.
1 parent 72998e1 commit 091df3a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/action_view/helpers/prototype_helper.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,15 @@ def render(*options)
546546
end
547547

548548
def with_formats(*args)
549-
@context ? @context.lookup_context.update_details(:formats => args) { yield } : yield
549+
return yield unless @context
550+
551+
lookup = @context.lookup_context
552+
begin
553+
old_formats, lookup.formats = lookup.formats, args
554+
yield
555+
ensure
556+
lookup.formats = old_formats
557+
end
550558
end
551559

552560
def javascript_object_for(object)

0 commit comments

Comments
 (0)