Class: MarcationsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- MarcationsController
- Defined in:
- app/controllers/marcations_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /marcations POST /marcations.json.
-
#destroy ⇒ Object
DELETE /marcations/1 DELETE /marcations/1.json.
-
#edit ⇒ Object
GET /marcations/1/edit.
-
#index ⇒ Object
GET /marcations GET /marcations.json.
-
#new ⇒ Object
GET /marcations/new GET /marcations/new.json.
-
#show ⇒ Object
GET /marcations/1 GET /marcations/1.json.
-
#update ⇒ Object
PUT /marcations/1 PUT /marcations/1.json.
Instance Method Details
#create ⇒ Object
POST /marcations POST /marcations.json
37 38 39 40 41 42 43 |
# File 'app/controllers/marcations_controller.rb', line 37 def create @marcation = @tour.marcations.create(params[:marcation]) # if @marcation.save # flash[:notice] = "Marcation was successfully created." # end respond_with @marcation end |
#destroy ⇒ Object
DELETE /marcations/1 DELETE /marcations/1.json
61 62 63 64 65 66 |
# File 'app/controllers/marcations_controller.rb', line 61 def destroy @marcation = @tour.marcations.find(params[:id]) @marcation.destroy # flash[:notice] = "Marcation was successfully destroyed." respond_with @marcation end |
#edit ⇒ Object
GET /marcations/1/edit
30 31 32 33 |
# File 'app/controllers/marcations_controller.rb', line 30 def edit @marcation = @tour.marcations.find(params[:id]) respond_with @marcation end |
#index ⇒ Object
GET /marcations GET /marcations.json
10 11 12 13 |
# File 'app/controllers/marcations_controller.rb', line 10 def index @marcations = @tour.marcations respond_with @marcations end |
#new ⇒ Object
GET /marcations/new GET /marcations/new.json
24 25 26 27 |
# File 'app/controllers/marcations_controller.rb', line 24 def new @marcation = @tour.marcations.create params[:marcation] respond_with @marcation end |
#show ⇒ Object
GET /marcations/1 GET /marcations/1.json
17 18 19 20 |
# File 'app/controllers/marcations_controller.rb', line 17 def show @marcation = @tour.marcations.find(params[:id]) respond_with @marcation end |
#update ⇒ Object
PUT /marcations/1 PUT /marcations/1.json
47 48 49 50 51 52 53 54 55 56 57 |
# File 'app/controllers/marcations_controller.rb', line 47 def update @marcation = @tour.marcations.find(params[:id]) if @marcation.update_attributes(params[:marcation]) flash[:notice] = "Marcation was successfully updated." end respond_with @marcation # respond_with @marcation do |format| # format.json { render json: @marcation } # end end |