osem-fcy/app/controllers/api/v1/events_controller.rb

12 lines
340 B
Ruby
Raw Normal View History

2013-07-08 10:07:12 +02:00
class Api::V1::EventsController < Api::BaseController
respond_to :json
def index
events = Event.includes(:conference, :track, :room, :event_type, {:event_people => :person})
unless params[:conference_id].blank?
events = events.where("conferences.guid" => params[:conference_id])
end
respond_with events
end
end