From: Jason James Date: 2009-02-22T05:41:34+09:00 Subject: Re: Hashed_Pasword? 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 -- Posted via http://www.ruby-forum.com/.