Adding api/v1/conferences/x/conferences

* A little weird, but needed by suseconferenceclient
This commit is contained in:
Ancor Gonzalez Sosa 2013-07-16 17:04:48 +02:00
parent 2553bd4e03
commit 740a604c01
2 changed files with 7 additions and 1 deletions

View file

@ -2,6 +2,11 @@ class Api::V1::ConferencesController < Api::BaseController
respond_to :json
def index
render :json => Conference.all, :serializer => ConferencesArraySerializer
if params[:conference_id].blank?
conferences = Conference.all
else
conferences = Conference.find_all_by_guid(params[:conference_id])
end
render :json => conferences, :serializer => ConferencesArraySerializer
end
end

View file

@ -65,6 +65,7 @@ Osem::Application.routes.draw do
namespace :api, defaults: {format: 'json'} do
namespace :v1 do
resources :conferences, :only => :index do
resources :conferences, :only => :index
resources :rooms, :only => :index
resources :tracks, :only => :index
resources :speakers, :only => :index