2014-08-07 07:42:22 +03:00
|
|
|
module Api
|
|
|
|
|
module V1
|
|
|
|
|
class RoomsController < Api::BaseController
|
2015-10-25 00:36:23 +03:00
|
|
|
load_resource :conference, find_by: :short_title
|
2014-08-07 07:42:22 +03:00
|
|
|
respond_to :json
|
2013-07-08 10:07:12 +02:00
|
|
|
|
2014-08-07 07:42:22 +03:00
|
|
|
def index
|
2015-11-07 11:43:36 +02:00
|
|
|
if params[:conference_id].blank?
|
|
|
|
|
rooms = Room.all
|
|
|
|
|
else
|
|
|
|
|
conference = Conference.find_by_guid(params[:conference_id])
|
|
|
|
|
rooms = conference.venue.rooms if conference.venue
|
|
|
|
|
end
|
2014-08-07 07:42:22 +03:00
|
|
|
respond_with rooms
|
|
|
|
|
end
|
2013-07-08 10:07:12 +02:00
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|