From: Jason James Date: 2009-02-22T06:17:26+09:00 Subject: Re: Hashed_Pasword? Jason James wrote: > Tim Hunter wrote: >> Jason James wrote: >>> Error message from the web server: >>> undefined local variable or method `hashed_password' for #>> login: "", email: "", hashed_passwd: nil> >>> >>> I am stuck! >> >> Is the variable named hashed_password or hashed_passwd? > > Here is the entire section of code : > def self.authenticate(login, password) > user = find_by_login(login) > return user if user && user.authenticated?(password) > end > > def authenticated?(password) > hashed_password == encrypt(password) > end > > protected > def encrypt_new_password > return if password.blank? > self.hashed_password = encrypt(password) > end > > def password_required? > hashed_password.blank? || !password.blank? > end > > def encrypt(string) > Digest::SHA1.hexdigest(string) > end The web server is calling out line 47 which is hashed_password.blank? || !password.blank? I think the hashed_password.blank? is my problem but I do not know why. the variable is hashed_password. -- Posted via http://www.ruby-forum.com/.