mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Check for to_str rather than String
This commit is contained in:
@@ -254,7 +254,7 @@ module ActionController
|
||||
render_for_text(js)
|
||||
|
||||
elsif json = options[:json]
|
||||
json = ActiveSupport::JSON.encode(json) unless json.is_a?(String)
|
||||
json = ActiveSupport::JSON.encode(json) unless json.respond_to?(:to_str)
|
||||
json = "#{options[:callback]}(#{json})" unless options[:callback].blank?
|
||||
response.content_type ||= Mime::JSON
|
||||
render_for_text(json)
|
||||
|
||||
Reference in New Issue
Block a user