aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/base/render.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2009-04-30 16:34:00 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2009-04-30 16:34:00 -0700
commitf0b9e2861943d32ca73a53ab5fb6f86d10c89b04 (patch)
treec4df24e5369c67690c372bd4c9749a6f8a01a806 /actionpack/lib/action_controller/base/render.rb
parent00d1a57e9f99a1b2439281cb741fd82ef47a5c55 (diff)
downloadrails-f0b9e2861943d32ca73a53ab5fb6f86d10c89b04.tar.gz
rails-f0b9e2861943d32ca73a53ab5fb6f86d10c89b04.tar.bz2
rails-f0b9e2861943d32ca73a53ab5fb6f86d10c89b04.zip
Fix render :json => nil [#2589 state:resolved]
Diffstat (limited to 'actionpack/lib/action_controller/base/render.rb')
-rw-r--r--actionpack/lib/action_controller/base/render.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/base/render.rb b/actionpack/lib/action_controller/base/render.rb
index 4286577ec5..cc0d878e01 100644
--- a/actionpack/lib/action_controller/base/render.rb
+++ b/actionpack/lib/action_controller/base/render.rb
@@ -253,7 +253,8 @@ module ActionController
response.content_type ||= Mime::JS
render_for_text(js)
- elsif json = options[:json]
+ elsif options.include?(:json)
+ json = options[:json]
json = ActiveSupport::JSON.encode(json) unless json.respond_to?(:to_str)
json = "#{options[:callback]}(#{json})" unless options[:callback].blank?
response.content_type ||= Mime::JSON