diff options
author | José Valim <jose.valim@gmail.com> | 2011-04-18 08:12:51 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-04-18 08:12:51 +0200 |
commit | 4f044528c0373b0a581a12b1311a7a544ded6c58 (patch) | |
tree | 2aa96082073fe9e5c8df88fed86d0f303c7d49cc /actionpack/lib/action_controller/metal/renderers.rb | |
parent | b839d4093356914b305b6fd0140782e8e198402e (diff) | |
download | rails-4f044528c0373b0a581a12b1311a7a544ded6c58.tar.gz rails-4f044528c0373b0a581a12b1311a7a544ded6c58.tar.bz2 rails-4f044528c0373b0a581a12b1311a7a544ded6c58.zip |
Slightly reorganize rendering stack.
Diffstat (limited to 'actionpack/lib/action_controller/metal/renderers.rb')
-rw-r--r-- | actionpack/lib/action_controller/metal/renderers.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/metal/renderers.rb b/actionpack/lib/action_controller/metal/renderers.rb index dfda6618e7..0ad9dbeda9 100644 --- a/actionpack/lib/action_controller/metal/renderers.rb +++ b/actionpack/lib/action_controller/metal/renderers.rb @@ -95,17 +95,17 @@ module ActionController json = json.to_json(options) unless json.kind_of?(String) json = "#{options[:callback]}(#{json})" unless options[:callback].blank? self.content_type ||= Mime::JSON - self.response_body = json + json end add :js do |js, options| self.content_type ||= Mime::JS - self.response_body = js.respond_to?(:to_js) ? js.to_js(options) : js + js.respond_to?(:to_js) ? js.to_js(options) : js end add :xml do |xml, options| self.content_type ||= Mime::XML - self.response_body = xml.respond_to?(:to_xml) ? xml.to_xml(options) : xml + xml.respond_to?(:to_xml) ? xml.to_xml(options) : xml end end end |