diff --git a/app/controllers/api/events_controller.rb b/app/controllers/api/events_controller.rb index ac7f0a8..fca1450 100644 --- a/app/controllers/api/events_controller.rb +++ b/app/controllers/api/events_controller.rb @@ -9,6 +9,5 @@ class Api::EventsController < Api::ApplicationController def halfnarp_friendly @events = current_conference.events.joins(:proposition).includes(:track, :event_type).where.not(propositions: {status: :rejected}) - render json: @events, include: [:track, :event_type] end end diff --git a/app/views/api/events/halfnarp_friendly.jbuilder b/app/views/api/events/halfnarp_friendly.jbuilder new file mode 100644 index 0000000..2ac6672 --- /dev/null +++ b/app/views/api/events/halfnarp_friendly.jbuilder @@ -0,0 +1,13 @@ +json.array! @events do |event| + json.id event.id + json.title event.title + json.abstract event.abstract + json.track_id event.track_id + + json.track do + json.name event.track.name + end + json.event_type do + json.name event.event_type.name + end +end