def new_user
@user = User.new
if request.post?
@user.attributes = params[:user]
if @user.save
flash[:notice] = 'User was successfully created.'
redirect_to :action => 'list'
return
end
end
end
This makes a GET render with a blank form, while a POST will redirect
if successful, or render with the user's values carrying forward (so
errors can be corrected). You can use error_messages_for(:user) in the
view to show the errors.
Thanks for the tip, but it does not work. After I input the data in the field and finally press the submit button, it clears ALL data and gives me the validate_presence_off errors.