aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/prototype_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_view/helpers/prototype_helper.rb')
-rw-r--r--actionpack/lib/action_view/helpers/prototype_helper.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/helpers/prototype_helper.rb b/actionpack/lib/action_view/helpers/prototype_helper.rb
index 33e52bfa6e..d1f992486f 100644
--- a/actionpack/lib/action_view/helpers/prototype_helper.rb
+++ b/actionpack/lib/action_view/helpers/prototype_helper.rb
@@ -631,9 +631,13 @@ module ActionView
end
def render(*options_for_render)
+ old_format = @context && @context.template_format
+ @context.template_format = :html if @context
Hash === options_for_render.first ?
@context.render(*options_for_render) :
options_for_render.first.to_s
+ ensure
+ @context.template_format = old_format if @context
end
def javascript_object_for(object)