diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-12-09 22:11:37 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-12-09 22:11:37 +0000 |
commit | bafd698acb160fd241efe6f027b83676b9e80d1f (patch) | |
tree | fa23a0ef6f6e774b7ce74000b1742c88bd4fc953 /actionpack/lib | |
parent | 3fab196da37ef76cfce040717d4176945212aea8 (diff) | |
download | rails-bafd698acb160fd241efe6f027b83676b9e80d1f.tar.gz rails-bafd698acb160fd241efe6f027b83676b9e80d1f.tar.bz2 rails-bafd698acb160fd241efe6f027b83676b9e80d1f.zip |
render :xml and :json preserve custom content types. Closes #10388.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8342 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib')
-rwxr-xr-x | actionpack/lib/action_controller/base.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb index b5c4780f52..f1d416d664 100755 --- a/actionpack/lib/action_controller/base.rb +++ b/actionpack/lib/action_controller/base.rb @@ -873,13 +873,13 @@ module ActionController #:nodoc: end elsif xml = options[:xml] - response.content_type = Mime::XML + response.content_type ||= Mime::XML render_for_text(xml.respond_to?(:to_xml) ? xml.to_xml : xml, options[:status]) elsif json = options[:json] json = json.to_json unless json.is_a?(String) json = "#{options[:callback]}(#{json})" unless options[:callback].blank? - response.content_type = Mime::JSON + response.content_type ||= Mime::JSON render_for_text(json, options[:status]) elsif partial = options[:partial] |