Guest User

Untitled

a guest
Jun 19th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. elsif options.include?(:json)
  2. json = options[:json]
  3. json = ActiveSupport::JSON.encode(json) unless json.is_a?(String)
  4. json = "#{options[:callback]}(#{json})" unless options[:callback].blank?
  5. response.content_type ||= Mime::JSON
  6. render_for_text(json, options[:status])
Add Comment
Please, Sign In to add comment