[Rails] Re: Cannot get my password to validate

2009-09-12 Thread Rakoth
Hello! Try to look at authlogic plugin for user authentication: http://github.com/binarylogic/authlogic/tree/master Its really cool! if password.include?( ) errors.add(:password, Must be filled in) why?? for saving crypted password in database use before_create callback class User

[Rails] Re: Cannot get my password to validate

2009-09-12 Thread Sijo Kg
Hi You can solve it like @user.password = Digest::SHA1.hexdigest(@user.password) if @user.valid? Change only the above line . What happens in your code is empty string also gets digested So fails validation. Sijo -- Posted via http://www.ruby-forum.com/.

[Rails] Re: Cannot get my password to validate

2009-09-12 Thread westy
Thanks!! @user.password = Digest::SHA1.hexdigest(@user.password) if @user.valid? works perfectly! thanks a lot!! On 12 Sep, 09:54, Sijo Kg rails-mailing-l...@andreas-s.net wrote: Hi     You can solve it like             @user.password = Digest::SHA1.hexdigest(@user.password) if