clarion/app/controllers/api/events_controller.rb

15 lines
289 B
Ruby
Raw Normal View History

class Api::EventsController < Api::ApplicationController
def index
@conference = find_conference
@events = @conference.events.includes(:track)
render json: @events, include: :track
end
private
def find_conference
Conference.find params[:conference_id]
end
end