Thanks ahead of time for everyone who will help out with this.
I have a profile page for a blog engine I'm writing (because everyone
much write a blog engine at some point to learn stuff) and I want to
allow members the ability to update their passwords. What I'm having a
problem with right now is using the edit page for their profile to
update their email and name (which is already populated from the
database), which works, but also use it to update the password (which
does not ... because it updates the password to blank every time).
The situation is this: I am both salting and hashing the password, and
using the attr_accessor to grab the password they input on the
registration page. However, now when they update their profile, the
blank password field generates a new hash and salt and leaves the
password blank. Not ideal.
I'm wondering how I might be able to selectively update the password
if a new password is supplied ... but leave it alone if a password is
Any help is greatly appreciated!