Rails 4: add jsonp responses

On your controller’s method that handles the jsonp response:

render :json => your_data_object_here.to_json, :callback => params[:callback]

Leave a Reply

Your email address will not be published. Required fields are marked *