Class: Spina::Admin::Conferences::PresentationAttachmentTypesController
- Inherits:
-
ApplicationController
- Object
- AdminController
- ApplicationController
- Spina::Admin::Conferences::PresentationAttachmentTypesController
- Defined in:
- app/controllers/spina/admin/conferences/presentation_attachment_types_controller.rb
Overview
Controller for PresentationAttachmentType objects.
Actions collapse
-
#create ⇒ void
Creates a presentation attachment type.
-
#destroy ⇒ void
Destroys a presentation attachment type.
-
#edit ⇒ void
Renders a form for an existing presentation attachment type.
-
#index ⇒ void
Renders a list of presentation attachment types.
-
#new ⇒ void
Renders a form for a new presentation attachment type.
-
#update ⇒ void
Updates a presentation attachment type.
Instance Method Details
#create ⇒ void
This method returns an undefined value.
Creates a presentation attachment type.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'app/controllers/spina/admin/conferences/presentation_attachment_types_controller.rb', line 35 def create # rubocop:disable Metrics/MethodLength @presentation_attachment_type = PresentationAttachmentType.new if @presentation_attachment_type.save redirect_to , success: t('.saved') else respond_to do |format| format.html do t('.new') render :new end format.turbo_stream { render partial: 'errors', locals: { errors: @presentation_attachment_type.errors } } end end end |
#destroy ⇒ void
This method returns an undefined value.
Destroys a presentation attachment type.
69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'app/controllers/spina/admin/conferences/presentation_attachment_types_controller.rb', line 69 def destroy # rubocop:disable Metrics/MethodLength if @presentation_attachment_type.destroy redirect_to , success: t('.destroyed') else respond_to do |format| format.html do @presentation_attachment_type.name render :edit end format.turbo_stream { render partial: 'errors', locals: { errors: @presentation_attachment_type.errors } } end end end |
#edit ⇒ void
This method returns an undefined value.
Renders a form for an existing presentation attachment type.
29 30 31 |
# File 'app/controllers/spina/admin/conferences/presentation_attachment_types_controller.rb', line 29 def edit @presentation_attachment_type.name end |
#index ⇒ void
This method returns an undefined value.
Renders a list of presentation attachment types.
16 17 18 |
# File 'app/controllers/spina/admin/conferences/presentation_attachment_types_controller.rb', line 16 def index @presentation_attachment_types = PresentationAttachmentType.sorted.page(params[:page]) end |
#new ⇒ void
This method returns an undefined value.
Renders a form for a new presentation attachment type.
22 23 24 25 |
# File 'app/controllers/spina/admin/conferences/presentation_attachment_types_controller.rb', line 22 def new @presentation_attachment_type = PresentationAttachmentType.new t('.new') end |
#update ⇒ void
This method returns an undefined value.
Updates a presentation attachment type.
53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'app/controllers/spina/admin/conferences/presentation_attachment_types_controller.rb', line 53 def update # rubocop:disable Metrics/MethodLength if @presentation_attachment_type.update() redirect_to , success: t('.saved') else respond_to do |format| format.html do @presentation_attachment_type.name render :edit end format.turbo_stream { render partial: 'errors', locals: { errors: @presentation_attachment_type.errors } } end end end |