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

14 lines
313 B
Ruby
Raw Normal View History

2013-07-08 10:07:12 +02:00
class Api::V1::TracksController < Api::BaseController
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
respond_with tracks
end
end