Code on pastie.caboo.se
def create
@my_object = MyObject.new(params[:my_object])
@my_object.save! # save or raise an exception
rescue ActiveRecord::RecordInvalid
flash.now[:notice] = 'Invalid record!'
render :action => :new
else
redirect_to my_object_path(@my_object)
flash[:notice] = 'Record created!'
end create is missing
(
Read more... )
Comments 1
Reply
Leave a comment