From 740a604c0175559464e35543a956a926ac6ec58f Mon Sep 17 00:00:00 2001 From: Ancor Gonzalez Sosa Date: Tue, 16 Jul 2013 17:04:48 +0200 Subject: [PATCH] Adding api/v1/conferences/x/conferences * A little weird, but needed by suseconferenceclient --- app/controllers/api/v1/conferences_controller.rb | 7 ++++++- config/routes.rb | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/controllers/api/v1/conferences_controller.rb b/app/controllers/api/v1/conferences_controller.rb index 77d6f053..4a851b94 100644 --- a/app/controllers/api/v1/conferences_controller.rb +++ b/app/controllers/api/v1/conferences_controller.rb @@ -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 diff --git a/config/routes.rb b/config/routes.rb index 2b78d62a..0cbeab15 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -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