views:

32

answers:

1

I'm setting up an edit profile page. And the password is available for change on it.

The only problem is that the password_field gets prepopulated with the password, and when they just want to change their name, they must also change their password as well.

Does anyone know a common workaround to this?

+1  A: 

Can I assume this is about a profile page on a web page and that you can set any attribute? I'm not a Rails programmer, but in HTML, this is all it takes (the autocomplete attribute):

<input type="password" autocomplete="off" value="">

If you have that in place, browsers will not autofill or remember the passwords.

Abel
Kudos for nailing a rails problem. You make it seem not so magical anymore :D
Trip
I think you shouldn't blame rails for it - it depends actually on the browser you use. Firefox fills in forms that where non-empty inputs hasn't been submitted last time, that's magic, too.
giraff
Indeed, this is not a Rails problem. It's an HTML feature that you can take care of by using the correct attributes. Firefox, IE, Opera, any browser will honor this attribute. The magic that @giraff talks of will not happen when `autocomplete` is set to `off`.
Abel