Skip to content

Instantly share code, notes, and snippets.

@bogdan
Created October 25, 2010 09:10
Show Gist options
  • Save bogdan/644651 to your computer and use it in GitHub Desktop.
Save bogdan/644651 to your computer and use it in GitHub Desktop.
elsif options.include?(:json)
json = options[:json]
json = ActiveSupport::JSON.encode(json) unless json.is_a?(String)
json = "#{options[:callback]}(#{json})" unless options[:callback].blank?
response.content_type ||= Mime::JSON
render_for_text(json, options[:status])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment