class ThingsController < ApplicationController
make_resourceful do
actions :all
end
def create
@thing = Thing.new(params[:thing])
respond_to do |format|
if @thing.save
flash[:notice] = 'Thing was successfully created.'
format.html { redirect_to thing_url(@thing) }
else
format.html { render :action => "new" }
end
end
end
def update
@thing = Thing.find(params[:id])
respond_to do |format|
if @thing.update_attributes(params[:thing])
flash[:notice] = 'Thing was successfully updated.'
format.html { redirect_to thing_url(@thing) }
else
format.html { render :action => "edit" }
end
end
end
def destroy
@thing = Thing.find(params[:id])
@thing.destroy
respond_to do |format|
format.html { redirect_to things_url }
end
end
end