diff options
author | Peter Kozak <spag@golwen.net> | 2013-02-12 13:07:05 +0000 |
---|---|---|
committer | Peter Kozak <spag@golwen.net> | 2013-02-12 13:07:05 +0000 |
commit | 902447a1baf7e9d8385c269a601361c8c3f2f14b (patch) | |
tree | 274f7e215471aa81d8916d343cc0c65f1de33217 /app/controllers | |
parent | 1ca26f823692d1cccb220a07ac8e7841c14dced3 (diff) |
parking_stall added
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/parking_stalls_controller.rb | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/app/controllers/parking_stalls_controller.rb b/app/controllers/parking_stalls_controller.rb new file mode 100644 index 0000000..42931ed --- /dev/null +++ b/app/controllers/parking_stalls_controller.rb @@ -0,0 +1,41 @@ +class ParkingStallsController < ApplicationController + def index + @parking_stalls = ParkingStall.all + end + + def show + @parking_stall = ParkingStall.find(params[:id]) + end + + def new + @parking_stall = ParkingStall.new + end + + def create + @parking_stall = ParkingStall.new(params[:parking_stall]) + if @parking_stall.save + redirect_to @parking_stall, :notice => t('parking_stalls.controller.successfuly_created') + else + render :new + end + end + + def edit + @parking_stall = ParkingStall.find(params[:id]) + end + + def update + @parking_stall = ParkingStall.find(params[:id]) + if @parking_stall.update_attributes(params[:parking_stall]) + redirect_to @parking_stall, :notice => t('parking_stalls.controller.successfuly_updated') + else + render :edit + end + end + + def destroy + @parking_stall = ParkingStall.find(params[:id]) + @parking_stall.destroy + redirect_to parking_stalls_url, :notice => t('parking_stalls.controller.successfuly_destroyed') + end +end |