Forum: Ruby on Rails password bug

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
3ed4f357a3b88a25fbe32d1fb384b13d?d=identicon&s=25 Arthur Fruchtman (arthurfruchtman)
on 2007-04-11 17:14
I have a form where you sign up for an account on my RoR site. I have
checks to make sure each text box has data in it. If I submit the form
with all empty boxes, the page will be refreshed with errors (userID
cannot be blank, email cannot be blank, etc.) Which is fine, but the
password field is filled with asterisks. I think that its the encrypted
'blank' password that shows up. How can I get it to be blank?

Thanks a lot
44f358318440218143f92fcbf271b90f?d=identicon&s=25 Lpp Rob (lpp-rob)
on 2007-12-14 16:51
I have the same problem. I have a registration, checking with
validates_confirmation_of if the pwd and the pwd_confirmation are the
same. If not the pwd field is filled with stars!
I want it to be blank too!

2d8132658d56e51f19ace1c68e48b6aa?d=identicon&s=25 Thorsten Mueller (thorsten)
on 2007-12-14 17:23
common thing, and you're right, it's the password content.
two ways to solve that:

1) in controller set password to nil
(and make sure later, that this does not lead to empty passwords being

2) create an additional attr_accessor :password_input
(like password_confirmation)
and make sure, that it's stored in db

before_save would be a good place to do that
44f358318440218143f92fcbf271b90f?d=identicon&s=25 Lpp Rob (lpp-rob)
on 2007-12-14 18:13
thx thorsten

i just found the exact same articel...i just didn't get to set the
password in the controller to nil.
i set the :value => "" it works fine too.
How would i do that out of the controller?
This topic is locked and can not be replied to.