From f0b9e2861943d32ca73a53ab5fb6f86d10c89b04 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Thu, 30 Apr 2009 16:34:00 -0700 Subject: Fix render :json => nil [#2589 state:resolved] --- actionpack/lib/action_controller/base/render.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'actionpack/lib/action_controller/base/render.rb') 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 -- cgit v1.2.3