Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def json_or_jsonp( json )
- callback = params.delete('callback')
- if callback
- content_type :js
- response = "#{callback}(#{json})"
- else
- content_type :json
- response = json
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement