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

18 lines
386 B
Ruby
Raw Normal View History

2014-08-07 07:42:22 +03:00
module Api
module V1
class TracksController < Api::BaseController
respond_to :json
2013-07-08 10:07:12 +02:00
2014-08-07 07:42:22 +03:00
def index
if params[:conference_id].blank?
tracks = Track.all
else
tracks = Track.joins(:conference)
2014-08-27 16:18:35 +02:00
tracks = tracks.where(conferences: { guid: params[:conference_id] })
2014-08-07 07:42:22 +03:00
end
respond_with tracks
end
2013-07-08 10:07:12 +02:00
end
end
end