Class: ActsAsAddressable::LocationsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- ActsAsAddressable::LocationsController
- Defined in:
- app/controllers/acts_as_addressable/locations_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /locations.
-
#destroy ⇒ Object
DELETE /locations/1.
-
#edit ⇒ Object
GET /locations/1/edit.
-
#index ⇒ Object
GET /locations.
-
#new ⇒ Object
GET /locations/new.
-
#show ⇒ Object
GET /locations/1.
-
#update ⇒ Object
PATCH/PUT /locations/1.
Instance Method Details
#create ⇒ Object
POST /locations
26 27 28 29 30 31 32 33 34 |
# File 'app/controllers/acts_as_addressable/locations_controller.rb', line 26 def create @location = Location.new(location_params) if @location.save redirect_to @location, notice: 'Location was successfully created.' else render :new end end |
#destroy ⇒ Object
DELETE /locations/1
46 47 48 49 |
# File 'app/controllers/acts_as_addressable/locations_controller.rb', line 46 def destroy @location.destroy redirect_to locations_url, notice: 'Location was successfully destroyed.' end |
#edit ⇒ Object
GET /locations/1/edit
22 23 |
# File 'app/controllers/acts_as_addressable/locations_controller.rb', line 22 def edit end |
#index ⇒ Object
GET /locations
8 9 10 |
# File 'app/controllers/acts_as_addressable/locations_controller.rb', line 8 def index @locations = Location.all end |
#new ⇒ Object
GET /locations/new
17 18 19 |
# File 'app/controllers/acts_as_addressable/locations_controller.rb', line 17 def new @location = Location.new end |
#show ⇒ Object
GET /locations/1
13 14 |
# File 'app/controllers/acts_as_addressable/locations_controller.rb', line 13 def show end |
#update ⇒ Object
PATCH/PUT /locations/1
37 38 39 40 41 42 43 |
# File 'app/controllers/acts_as_addressable/locations_controller.rb', line 37 def update if @location.update(location_params) redirect_to @location, notice: 'Location was successfully updated.' else render :edit end end |