Class: EventSpeakersController

Inherits:
AdminController
  • Object
show all
Defined in:
app/controllers/event_speakers_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject

post /event_speakers



5
6
7
8
9
10
11
12
# File 'app/controllers/event_speakers_controller.rb', line 5

def create
  @entity = EventSpeaker.new(creation_parameters)
  if @entity.save
    redirect_to(admin_event_path(id: @entity.event_id))
  else
    render :new, status: :bad_request
  end
end

#destroyObject

delete /event_speakers/:id



28
29
30
31
32
33
# File 'app/controllers/event_speakers_controller.rb', line 28

def destroy
  if @entity.destroy
    flash[:notice] = t('event_speakers.destroy.success')
  end
  redirect_to admin_event_path(id: @entity.event_id)
end

#editObject

get /event_speakers/:id/edit



15
16
# File 'app/controllers/event_speakers_controller.rb', line 15

def edit
end

#updateObject

patch /event_speakers/:id



19
20
21
22
23
24
25
# File 'app/controllers/event_speakers_controller.rb', line 19

def update
  if @entity.update(entity_parameters)
    redirect_to admin_event_path(id: @entity.event_id), notice: t('event_speakers.update.success')
  else
    render :edit, status: :bad_request
  end
end