Class: EventParticipantsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- EventParticipantsController
- Defined in:
- app/controllers/event_participants_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
-
#destroy ⇒ Object
delete /event_participants/:id.
Instance Method Details
#create ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'app/controllers/event_participants_controller.rb', line 5 def create @entity = EventParticipant.new(creation_parameters) if @entity.save Metric.register(EventParticipant::METRIC_CREATED) redirect_to event_path(id: @entity.event_id), notice: t('event_participants.create.success') else render :new, status: :bad_request end end |
#destroy ⇒ Object
delete /event_participants/:id
16 17 18 19 |
# File 'app/controllers/event_participants_controller.rb', line 16 def destroy @entity.destroy redirect_to admin_event_path(id: @entity.event_id) end |