diff --git a/app/controllers/api/conferences_controller.rb b/app/controllers/api/conferences_controller.rb new file mode 100644 index 0000000..116570c --- /dev/null +++ b/app/controllers/api/conferences_controller.rb @@ -0,0 +1,7 @@ +class Api::ConferencesController < Api::ApplicationController + include ::PublicApiExposing + + def index + @conferences = Conference.all + end +end diff --git a/app/views/api/conferences/index.jbuilder b/app/views/api/conferences/index.jbuilder new file mode 100644 index 0000000..9ef7719 --- /dev/null +++ b/app/views/api/conferences/index.jbuilder @@ -0,0 +1 @@ +json.array! @conferences, :id, :title, :start_date, :end_date, :created_at, :updated_at diff --git a/config/routes.rb b/config/routes.rb index 95b0f16..d5740cc 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -17,7 +17,7 @@ Rails.application.routes.draw do end namespace :api do - resources :conferences, only: [] do + resources :conferences, only: [:index] do resources :events, only: :index do collection do get :halfnarp_friendly