Class: PlacesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/places_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject


21
22
23
24
25
26
27
# File 'app/controllers/places_controller.rb', line 21

def create
  @place = @placeable.places.new(place_params)
  authorize @place
  flash[:notice] = "Place created successfully!" if @place.save

  respond_with(@placeable)
end

#destroyObject


34
35
36
37
# File 'app/controllers/places_controller.rb', line 34

def destroy
  flash[:notice] = "Place deleted successfully!" if @place.destroy
  respond_with(@placeable)
end

#editObject


17
18
19
# File 'app/controllers/places_controller.rb', line 17

def edit
  
end

#indexObject


8
9
10
11
# File 'app/controllers/places_controller.rb', line 8

def index
  @places = @placeable.places
  respond_with(@places)
end

#showObject


13
14
15
# File 'app/controllers/places_controller.rb', line 13

def show
  respond_with(@place)
end

#updateObject


29
30
31
32
# File 'app/controllers/places_controller.rb', line 29

def update
  flash[:notice] = "Place updated successfully!" if @place.update(place_params)
  respond_with(@placeable)
end