clarion/app/controllers/api/events_controller.rb
Vencislav Atanasov b732aff523 Add CORS header in order to access the public API from JavaScript
(I have no idea what I'm doing)
2016-11-04 15:34:44 +02:00

15 lines
447 B
Ruby

class Api::EventsController < Api::ApplicationController
include ::CurrentConferenceAssigning
include ::PublicApiExposing
before_filter :require_current_conference!
def index
@events = current_conference.events.approved.joins(:proposition).includes(:participations)
end
def halfnarp_friendly
@events = current_conference.events.includes(:track, :event_type)
render json: @events, include: [:track, :event_type]
end
end