osem-fcy/app/controllers/api/v1/conferences_controller.rb
Rob Smith 70e0f42bbb Support JSONP callbacks for the API/v1 endpoints
SeaGL currently uses OSEM as a backend, but still has a static website
serving as our public interface. The API endpoints have a great amount
of data, but without the jsonp callback paramater, embedding the data
is a bit difficult. This change just adds the jsonp callback param
to all the API endpoints. This should be a NOOP for anyone using direct
json calls, but will allow cross domain requests that require jsonp.
2016-09-17 19:31:21 -07:00

16 lines
422 B
Ruby

module Api
module V1
class ConferencesController < Api::BaseController
load_resource find_by: :short_title
respond_to :json
def index
render json: @conferences, serializer: ConferencesArraySerializer, callback: params['callback']
end
def show
render json: [@conference], serializer: ConferencesArraySerializer, callback: params['callback']
end
end
end
end