Class: EventParticipantsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/event_participants_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



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

#destroyObject

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