aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-05-20 17:42:04 -0700
committerYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-05-20 17:42:04 -0700
commit7f7fdc407a90c9ce75ce0a77bc0f631115514d2f (patch)
treef4ed4c40060ec75b09309adf370ce3e84d072cb2 /actionpack/lib
parentc8eda9ade49700abce104de1ce7e8e1a754fc97e (diff)
downloadrails-7f7fdc407a90c9ce75ce0a77bc0f631115514d2f.tar.gz
rails-7f7fdc407a90c9ce75ce0a77bc0f631115514d2f.tar.bz2
rails-7f7fdc407a90c9ce75ce0a77bc0f631115514d2f.zip
Make controller/content_type_test.rb pass on new base
Diffstat (limited to 'actionpack/lib')
-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