Hi,
I can’t list error_messages in my Form ??, and all the formfields are
reset …(I think my redirect :back clean everything, formfield and
error_messages …), only my flash[:notice] is ok…
I would like to use the “error_messages_for” tag to add a simple red *
on my textfiled if a problem occurs …
thanks for help
arnaud
here are the basics steps to check that password and confirm_password
are equal:
a form:
<%= form_tag :controller => “contact”, :action => “addClient” %>
<%= error_messages_for ‘client’ %>
…
controller:
@client=Person.new(params)
if (@client.save)
redirect_to :action => “index”
else
flash[:notice] = “pb during registration !”
redirect_to :back
end
model:
I just define a validate method
def validate
errors.add(:password, “different password ! try again”) unless
:confirm_password == :password
end