Class: Admin::PrimerPanelsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/admin/primer_panels_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject


19
20
21
22
23
24
25
26
27
28
29
30
# File 'app/controllers/admin/primer_panels_controller.rb', line 19

def create
  @primer_panel = PrimerPanel.new(primer_panel_params)

  respond_to do |format|
    if @primer_panel.save
      flash[:notice] = "Created '#{@primer_panel.name}'"
      format.html { redirect_to(admin_primer_panels_path) }
    else
      format.html { render action: 'new' }
    end
  end
end

#editObject


17
# File 'app/controllers/admin/primer_panels_controller.rb', line 17

def edit; end

#indexObject


7
8
9
# File 'app/controllers/admin/primer_panels_controller.rb', line 7

def index
  @primer_panels = PrimerPanel.all
end

#newObject


11
12
13
# File 'app/controllers/admin/primer_panels_controller.rb', line 11

def new
  @primer_panel = PrimerPanel.new(programs: default_programs)
end

#showObject


15
# File 'app/controllers/admin/primer_panels_controller.rb', line 15

def show; end

#updateObject


32
33
34
35
36
37
38
39
40
41
# File 'app/controllers/admin/primer_panels_controller.rb', line 32

def update
  respond_to do |format|
    if @primer_panel.update(primer_panel_params)
      flash[:notice] = 'Primer Panel was successfully updated.'
      format.html { redirect_to(admin_primer_panels_path) }
    else
      format.html { render action: 'edit' }
    end
  end
end