aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/new_base/renderer.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_controller/new_base/renderer.rb')
-rw-r--r--actionpack/lib/action_controller/new_base/renderer.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/new_base/renderer.rb b/actionpack/lib/action_controller/new_base/renderer.rb
index 6176212970..81685ca9d6 100644
--- a/actionpack/lib/action_controller/new_base/renderer.rb
+++ b/actionpack/lib/action_controller/new_base/renderer.rb
@@ -38,7 +38,11 @@ module ActionController
ret = super(options)
options[:_template] ||= _action_view._partial
- response.content_type ||= options[:_template].mime_type
+ response.content_type ||= begin
+ mime = options[:_template].mime_type
+ mime &&= mime.to_sym
+ formats.include?(mime) ? mime : formats.first
+ end
ret
end