Class: Panel::LinesController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/ship/panel/lines_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



13
14
15
16
17
18
19
# File 'app/controllers/ship/panel/lines_controller.rb', line 13

def create
  @line = Line.new(line_params)

  unless @line.save
    render :new, locals: { model: @line }, status: :unprocessable_entity
  end
end

#destroyObject



35
36
37
# File 'app/controllers/ship/panel/lines_controller.rb', line 35

def destroy
  @line.destroy
end

#editObject



24
25
# File 'app/controllers/ship/panel/lines_controller.rb', line 24

def edit
end

#indexObject



5
6
7
# File 'app/controllers/ship/panel/lines_controller.rb', line 5

def index
  @lines = Line.page(params[:page])
end

#newObject



9
10
11
# File 'app/controllers/ship/panel/lines_controller.rb', line 9

def new
  @line = Line.new
end

#showObject



21
22
# File 'app/controllers/ship/panel/lines_controller.rb', line 21

def show
end

#updateObject



27
28
29
30
31
32
33
# File 'app/controllers/ship/panel/lines_controller.rb', line 27

def update
  @line.assign_attributes(line_params)

  unless @line.save
    render :edit, locals: { model: @line }, status: :unprocessable_entity
  end
end