Class: MarcationsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/marcations_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject

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

#destroyObject

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

#editObject

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

#indexObject

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

#newObject

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

#showObject

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

#updateObject

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