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

20 lines
557 B
Ruby
Raw Normal View History

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
# Disable forgery protection for any json requests. This is required for jsonp support
skip_before_action :verify_authenticity_token
2014-08-07 07:42:22 +03:00
def index
if @conference
respond_with @conference.venue ? @conference.venue.rooms : Room.none, callback: params[:callback]
2015-11-07 11:43:36 +02:00
else
respond_with Room.all, callback: params[:callback]
2015-11-07 11:43:36 +02:00
end
2014-08-07 07:42:22 +03:00
end
2013-07-08 10:07:12 +02:00
end
end
end