Class: EventSpeakersController
- Inherits:
-
AdminController
- Object
- AdminController
- EventSpeakersController
- Defined in:
- app/controllers/event_speakers_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
post /event_speakers.
-
#destroy ⇒ Object
delete /event_speakers/:id.
-
#edit ⇒ Object
get /event_speakers/:id/edit.
-
#update ⇒ Object
patch /event_speakers/:id.
Instance Method Details
#create ⇒ Object
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 |
#destroy ⇒ Object
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 |
#edit ⇒ Object
get /event_speakers/:id/edit
15 16 |
# File 'app/controllers/event_speakers_controller.rb', line 15 def edit end |
#update ⇒ Object
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 |