Class: Spina::Admin::Conferences::PresentationTypesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/spina/admin/conferences/presentation_types_controller.rb

Overview

Controller for PresentationType objects.

See Also:

Actions collapse

Instance Method Details

#createvoid

This method returns an undefined value.

Creates a presentation type.



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'app/controllers/spina/admin/conferences/presentation_types_controller.rb', line 38

def create # rubocop:disable Metrics/MethodLength
  @presentation_type = PresentationType.new presentation_type_params

  if @presentation_type.save
    redirect_to admin_conferences_presentation_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_type.errors } }
    end
  end
end

#destroyvoid

This method returns an undefined value.

Destroys a presentation type.



72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'app/controllers/spina/admin/conferences/presentation_types_controller.rb', line 72

def destroy # rubocop:disable Metrics/MethodLength
  if @presentation_type.destroy
    redirect_to admin_conferences_presentation_types_path, success: t('.destroyed')
  else
    respond_to do |format|
      format.html do
        add_breadcrumb @presentation_type.name
        render :edit
      end
      format.turbo_stream { render partial: 'errors', locals: { errors: @presentation_type.errors } }
    end
  end
end

#editvoid

This method returns an undefined value.

Renders a form for an existing presentation type.



32
33
34
# File 'app/controllers/spina/admin/conferences/presentation_types_controller.rb', line 32

def edit
  add_breadcrumb @presentation_type.name
end

#indexvoid

This method returns an undefined value.

Renders a list of presentation types.



19
20
21
# File 'app/controllers/spina/admin/conferences/presentation_types_controller.rb', line 19

def index
  @presentation_types = PresentationType.sorted.page(params[:page])
end

#newvoid

This method returns an undefined value.

Renders a form for a new presentation type.



25
26
27
28
# File 'app/controllers/spina/admin/conferences/presentation_types_controller.rb', line 25

def new
  @presentation_type = PresentationType.new
  add_breadcrumb t('.new')
end

#updatevoid

This method returns an undefined value.

Updates a presentation type.



56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'app/controllers/spina/admin/conferences/presentation_types_controller.rb', line 56

def update # rubocop:disable Metrics/MethodLength
  if @presentation_type.update(presentation_type_params)
    redirect_to admin_conferences_presentation_types_path, success: t('.saved')
  else
    respond_to do |format|
      format.html do
        add_breadcrumb @presentation_type.name
        render :edit
      end
      format.turbo_stream { render partial: 'errors', locals: { errors: @presentation_type.errors } }
    end
  end
end