Class: Mappable::MapsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Mappable::MapsController
- Defined in:
- app/controllers/mappable/maps_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
19 20 21 22 23 24 25 26 27 |
# File 'app/controllers/mappable/maps_controller.rb', line 19 def create @map = Map.new(params[:map]) if @map.save redirect_to maps_path, notice: 'Map was successfully created.' else render action: "new" end end |
#destroy ⇒ Object
39 40 41 42 43 44 |
# File 'app/controllers/mappable/maps_controller.rb', line 39 def destroy @map = Map.find(params[:id]) @map.destroy redirect_to maps_path end |
#edit ⇒ Object
15 16 17 |
# File 'app/controllers/mappable/maps_controller.rb', line 15 def edit @map = Map.find(params[:id]) end |
#index ⇒ Object
3 4 5 |
# File 'app/controllers/mappable/maps_controller.rb', line 3 def index @maps = Map.all end |
#new ⇒ Object
11 12 13 |
# File 'app/controllers/mappable/maps_controller.rb', line 11 def new @map = Map.new end |
#show ⇒ Object
7 8 9 |
# File 'app/controllers/mappable/maps_controller.rb', line 7 def show @map = Map.find(params[:id]) end |
#update ⇒ Object
29 30 31 32 33 34 35 36 37 |
# File 'app/controllers/mappable/maps_controller.rb', line 29 def update @map = Map.find(params[:id]) if @map.update_attributes(params[:map]) redirect_to maps_path, notice: 'Map was successfully updated.' else render action: "edit" end end |