laredotornado-8iDLEspWrrZBDgjK7y7TUQ@public.gmane.org
2008-Jan-17 19:39 UTC
implementing password confirmation
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: <p><label for="customer_password">Password</label><br/> <%= password_field ''customer'', ''password'' %></p> <p><label for="customer_password">Confirm Password</label><br/> <%= password_field ''password_confirmation'', '''' %></p> 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 For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> <p><label for="customer_password">Password</label><br/> > <%= password_field ''customer'', ''password'' %></p> > > <p><label for="customer_password">Confirm Password</label><br/> > <%= password_field ''password_confirmation'', '''' %></p>The second password_field looks bogus, check out the example at: http://www.railsapi.org/validates_confirmation_of -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
laredotornado-8iDLEspWrrZBDgjK7y7TUQ@public.gmane.org
2008-Jan-17 22:36 UTC
Re: implementing password confirmation
Thanks, but I guess because of my beginner-ness, I''m still confused. What should the second password_field look like in order to not be bogus? The link you sent doesn''t have an example of what it should look like on the view end. - Dave On Jan 17, 2:48 pm, Sven Schwyn <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > <p><label for="customer_password">Password</label><br/> > > <%= password_field ''customer'', ''password'' %></p> > > > <p><label for="customer_password">Confirm Password</label><br/> > > <%= password_field ''password_confirmation'', '''' %></p> > > The second password_field looks bogus, check out the example at:http://www.railsapi.org/validates_confirmation_of > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---