implementing password confirmation

laredotornado-8iDLEspWrrZBDgjK7y7TUQ@public.gmane.org
Thu, 17 Jan 2008 19:39:48 -0000

Hi,

I''m using the latest version of RoR.  I''m having a problem
with
passwords and password confirmations.  I have a db table and
corresponding model -- customer with a password field (but no password
confirmation field in the table).  Here is the simple customer model
code:

class Customer < ActiveRecord::Base
        belongs_to :subscriber

        validates_confirmation_of :password
end

Here is part of the view where I''m asking for a password and password
confirmation:

<label
for="customer_password">Password
<%= password_field ''customer'', ''password''
%>

Confirm
Password
<%= password_field ''password_confirmation'',
'''' %>

However, even if the passwords don''t match, the script allows me to
submit and save the customer.  What is missing from the above?

Thanks, - Dave

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org