Class: My::LocationsController
- Inherits:
-
BaseController
- Object
- BaseController
- My::LocationsController
- Defined in:
- app/controllers/ship/my/locations_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
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 |
#destroy ⇒ Object
36 37 38 |
# File 'app/controllers/ship/my/locations_controller.rb', line 36 def destroy @location.destroy end |
#edit ⇒ Object
25 26 |
# File 'app/controllers/ship/my/locations_controller.rb', line 25 def edit end |
#index ⇒ Object
6 7 8 |
# File 'app/controllers/ship/my/locations_controller.rb', line 6 def index @locations = Location.page(params[:page]) end |
#new ⇒ Object
10 11 12 |
# File 'app/controllers/ship/my/locations_controller.rb', line 10 def new @location = Location.new end |
#show ⇒ Object
22 23 |
# File 'app/controllers/ship/my/locations_controller.rb', line 22 def show end |
#update ⇒ Object
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 |