This commit is contained in:
Aditya Chatterjee 2016-02-27 17:03:43 +05:30
parent 28e55f3f50
commit a5a2db4077
156 changed files with 3203 additions and 1206 deletions

View file

@ -1,15 +1,12 @@
module Api
module V1
class TracksController < Api::BaseController
load_resource :conference, find_by: :short_title
respond_to :json
def index
if params[:conference_id].blank?
tracks = Track.all
else
tracks = Track.joins(:conference)
tracks = tracks.where(conferences: { guid: params[:conference_id] })
end
@conference ? (tracks = @conference.tracks) : (tracks = Track.all)
respond_with tracks
end
end