API with more options, includes #712

This commit is contained in:
Stella Rouzi 2015-10-25 00:36:23 +03:00
parent 28e55f3f50
commit ecef151f91
7 changed files with 86 additions and 38 deletions

View file

@ -1,15 +1,15 @@
module Api
module V1
class ConferencesController < Api::BaseController
load_resource find_by: :short_title
respond_to :json
def index
if params[:conference_id].blank?
conferences = Conference.all
else
conferences = Conference.find_all_by_guid(params[:conference_id])
end
render json: conferences, serializer: ConferencesArraySerializer
render json: @conferences, serializer: ConferencesArraySerializer
end
def show
render json: [@conference], serializer: ConferencesArraySerializer
end
end
end