views:

7

answers:

1

Hi,

I am making a update password module for an application in rails. Now the problem is that I am encrypting the password before_save, and it is required that the password be between 6 to 20, so after encryption the password becomes 64 chars, but since the encryption happens after validations, the code works. Now when I want to update the password, it may so happen that the user may not want to change his password. In such a case he leaves the password field empty, but now the form will not validate. How do i get around this?

A: 

This is the simplest approach for password management - Ruby on Rails Password Hashing Module

But I would recommend you to use Authlogic

zengr