Class: Spina::Admin::Conferences::PresentationAttachmentTypesController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/spina/admin/conferences/presentation_attachment_types_controller.rb

Overview

Controller for PresentationAttachmentType objects.

Actions collapse

Instance Method Details

#createvoid

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 presentation_attachment_type_params

  if @presentation_attachment_type.save
    redirect_to admin_conferences_presentation_attachment_types_path, success: t('.saved')
  else
    respond_to do |format|
      format.html do
        add_breadcrumb t('.new')
        render :new
      end
      format.turbo_stream { render partial: 'errors', locals: { errors: @presentation_attachment_type.errors } }
    end
  end
end

#destroyvoid

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 admin_conferences_presentation_attachment_types_path, success: t('.destroyed')
  else
    respond_to do |format|
      format.html do
        add_breadcrumb @presentation_attachment_type.name
        render :edit
      end
      format.turbo_stream { render partial: 'errors', locals: { errors: @presentation_attachment_type.errors } }
    end
  end
end

#editvoid

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
  add_breadcrumb @presentation_attachment_type.name
end

#indexvoid

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

#newvoid

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
  add_breadcrumb t('.new')
end

#updatevoid

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(presentation_attachment_type_params)
    redirect_to admin_conferences_presentation_attachment_types_path, success: t('.saved')
  else
    respond_to do |format|
      format.html do
        add_breadcrumb @presentation_attachment_type.name
        render :edit
      end
      format.turbo_stream { render partial: 'errors', locals: { errors: @presentation_attachment_type.errors } }
    end
  end
end