jam-cloud/web/app/controllers/api_rsvp_slots_controller.rb

32 lines
786 B
Ruby

class ApiRsvpSlotsController < ApiController
# before_filter :auth_user
respond_to :json
def index
if params[:session_id].blank?
render :json => {:message => "Session ID is required"}, :status => 400
else
music_session = MusicSession.find(params[:session_id])
# retrieve all slots for this session
@rsvp_slots = RsvpSlot.index(music_session)
respond_with @rsvp_slots, responder: ApiResponder, :status => 200
end
end
# def create
# if params[:id].blank? || params[:session_id].blank?
# render :json => {:message => "Session ID is required."}, :status => 400
# else
# @rsvp = RsvpRequest.create(params, current_user)
# respond_with @rsvp, responder: ApiResponder, :status => 201
# end
# end
end