Class: My::LocationsController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/ship/my/locations_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



14
15
16
17
18
19
20
# File 'app/controllers/ship/my/locations_controller.rb', line 14

def create
  @location = Location.new(location_params)

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

#destroyObject



36
37
38
# File 'app/controllers/ship/my/locations_controller.rb', line 36

def destroy
  @location.destroy
end

#editObject



25
26
# File 'app/controllers/ship/my/locations_controller.rb', line 25

def edit
end

#indexObject



6
7
8
# File 'app/controllers/ship/my/locations_controller.rb', line 6

def index
  @locations = Location.page(params[:page])
end

#newObject



10
11
12
# File 'app/controllers/ship/my/locations_controller.rb', line 10

def new
  @location = Location.new
end

#showObject



22
23
# File 'app/controllers/ship/my/locations_controller.rb', line 22

def show
end

#updateObject



28
29
30
31
32
33
34
# File 'app/controllers/ship/my/locations_controller.rb', line 28

def update
  @location.assign_attributes(location_params)

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