Class | PlacesController |
In: |
app/controllers/places_controller.rb
|
Parent: | ApplicationController |
POST /places POST /places.xml
# File app/controllers/places_controller.rb, line 43 43: def create 44: @place = Place.new(params[:place]) 45: 46: respond_to do |format| 47: if @place.save 48: flash[:notice] = 'Place was successfully created.' 49: format.html { redirect_to(@place) } 50: format.xml { render :xml => @place, :status => :created, :location => @place } 51: else 52: format.html { render :action => "new" } 53: format.xml { render :xml => @place.errors, :status => :unprocessable_entity } 54: end 55: end 56: end
DELETE /places/1 DELETE /places/1.xml
# File app/controllers/places_controller.rb, line 77 77: def destroy 78: @place = Place.find(params[:id]) 79: @place.destroy 80: 81: respond_to do |format| 82: format.html { redirect_to(places_url) } 83: format.xml { head :ok } 84: end 85: end
GET /places/1/edit
# File app/controllers/places_controller.rb, line 37 37: def edit 38: @place = Place.find(params[:id]) 39: end
GET /places GET /places.xml
# File app/controllers/places_controller.rb, line 5 5: def index 6: @places = Place.all 7: 8: respond_to do |format| 9: format.html # index.html.erb 10: format.xml { render :xml => @places } 11: end 12: end
GET /places/new GET /places/new.xml
# File app/controllers/places_controller.rb, line 27 27: def new 28: @place = Place.new 29: 30: respond_to do |format| 31: format.html # new.html.erb 32: format.xml { render :xml => @place } 33: end 34: end
GET /places/1 GET /places/1.xml
# File app/controllers/places_controller.rb, line 16 16: def show 17: @place = Place.find(params[:id]) 18: 19: respond_to do |format| 20: format.html # show.html.erb 21: format.xml { render :xml => @place } 22: end 23: end
PUT /places/1 PUT /places/1.xml
# File app/controllers/places_controller.rb, line 60 60: def update 61: @place = Place.find(params[:id]) 62: 63: respond_to do |format| 64: if @place.update_attributes(params[:place]) 65: flash[:notice] = 'Place was successfully updated.' 66: format.html { redirect_to(@place) } 67: format.xml { head :ok } 68: else 69: format.html { render :action => "edit" } 70: format.xml { render :xml => @place.errors, :status => :unprocessable_entity } 71: end 72: end 73: end