diff --git a/app/controllers/api/events_controller.rb b/app/controllers/api/events_controller.rb index 1be0cc6..ca6ec1c 100644 --- a/app/controllers/api/events_controller.rb +++ b/app/controllers/api/events_controller.rb @@ -5,4 +5,9 @@ class Api::EventsController < Api::ApplicationController def index @events = current_conference.events.includes(:participations) end + + def halfnarp_friendly + @events = current_conference.events.includes(:track, :event_type) + render json: @events, include: [:track, :event_type] + end end diff --git a/config/routes.rb b/config/routes.rb index 08149b9..8ef59e1 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -13,7 +13,11 @@ Rails.application.routes.draw do namespace :api do resources :conferences, only: [] do - resources :events, only: :index + resources :events, only: :index do + collection do + get :halfnarp_friendly + end + end resources :speakers, only: :index resources :tracks, only: :index resources :event_types, only: :index