diff options
author | Diego Carrion <dc.rec1@gmail.com> | 2010-09-18 11:00:23 -0300 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-09-27 23:11:29 +0200 |
commit | 72f37bd8bc5b3beb1e8a2d1ac2de2c045cd0cfd2 (patch) | |
tree | 012c2c8d99aec0c0f97bfb34c73c010471233d32 /actionpack/lib/action_controller | |
parent | 4966b915fe96db73933d33176c1ea5cc53e58a22 (diff) | |
download | rails-72f37bd8bc5b3beb1e8a2d1ac2de2c045cd0cfd2.tar.gz rails-72f37bd8bc5b3beb1e8a2d1ac2de2c045cd0cfd2.tar.bz2 rails-72f37bd8bc5b3beb1e8a2d1ac2de2c045cd0cfd2.zip |
renderer calls object.to_json when rendering :json => object [#5655 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/metal/renderers.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/metal/renderers.rb b/actionpack/lib/action_controller/metal/renderers.rb index 0be07cd1fc..f9b226b7c9 100644 --- a/actionpack/lib/action_controller/metal/renderers.rb +++ b/actionpack/lib/action_controller/metal/renderers.rb @@ -71,7 +71,7 @@ module ActionController end add :json do |json, options| - json = ActiveSupport::JSON.encode(json, options) unless json.respond_to?(:to_str) + json = json.to_json(options) unless json.respond_to?(:to_str) json = "#{options[:callback]}(#{json})" unless options[:callback].blank? self.content_type ||= Mime::JSON self.response_body = json |