Permalink
Browse files

Fix Rails 3.2 compatibility.

  • Loading branch information...
1 parent 72998e1 commit 091df3a5995cb0fe27740dfad744d1a78f071473 @josevalim josevalim committed Dec 20, 2011
Showing with 9 additions and 1 deletion.
  1. +9 −1 lib/action_view/helpers/prototype_helper.rb
@@ -546,7 +546,15 @@ def render(*options)
end
def with_formats(*args)
- @context ? @context.lookup_context.update_details(:formats => args) { yield } : yield
+ return yield unless @context
+
+ lookup = @context.lookup_context
+ begin
+ old_formats, lookup.formats = lookup.formats, args
+ yield
+ ensure
+ lookup.formats = old_formats
+ end
end
def javascript_object_for(object)

0 comments on commit 091df3a

Please sign in to comment.