aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/new_base/renderer.rb
diff options
context:
space:
mode:
authorYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-05-21 14:22:07 -0700
committerYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-05-21 14:34:56 -0700
commite693f45e155a81b6c337b8766870b56716a05105 (patch)
tree176d94bdc8aa6e072666f1a1ef9383ff809a18df /actionpack/lib/action_controller/new_base/renderer.rb
parent386ff66e5ed4fbe1e060610d4226a4eb22dca766 (diff)
downloadrails-e693f45e155a81b6c337b8766870b56716a05105.tar.gz
rails-e693f45e155a81b6c337b8766870b56716a05105.tar.bz2
rails-e693f45e155a81b6c337b8766870b56716a05105.zip
Remove some response content type concepts from ActionView
Diffstat (limited to 'actionpack/lib/action_controller/new_base/renderer.rb')
-rw-r--r--actionpack/lib/action_controller/new_base/renderer.rb20
1 files changed, 11 insertions, 9 deletions
diff --git a/actionpack/lib/action_controller/new_base/renderer.rb b/actionpack/lib/action_controller/new_base/renderer.rb
index 81685ca9d6..840168397d 100644
--- a/actionpack/lib/action_controller/new_base/renderer.rb
+++ b/actionpack/lib/action_controller/new_base/renderer.rb
@@ -14,6 +14,16 @@ module ActionController
super
end
+ def render(options)
+ super
+ options[:_template] ||= _action_view._partial
+ response.content_type ||= begin
+ mime = options[:_template].mime_type
+ formats.include?(mime && mime.to_sym) || formats.include?(:all) ? mime : Mime::Type.lookup_by_extension(formats.first)
+ end
+ response_body
+ end
+
def render_to_body(options)
_process_options(options)
@@ -35,15 +45,7 @@ module ActionController
options[:_prefix] = _prefix
end
- ret = super(options)
-
- options[:_template] ||= _action_view._partial
- response.content_type ||= begin
- mime = options[:_template].mime_type
- mime &&= mime.to_sym
- formats.include?(mime) ? mime : formats.first
- end
- ret
+ super
end
private