I have been learning Rails 3 from a video on Lynda.com, and it has been going well up until lately. What i'm trying to do currently is restrict access to certain pages unless a session is present where the user is authorized (has logged in). This is working correctly because when I try to access the pages that I want restricted, I get redirected to the login form. The problem comes up when I try to login. I put the correct username in, but when I put the password in, any password at all, it doesn't even need to be the correct one, I get an error page I made a user admin account for development purposes, and when I login I get this error:
NameError in AccessController#attempt_login
undefined local variable or method `salt' for #
Now, I don't know a ton about debugging as of right now, but based on the trace the method attempt_login in the access controller is the following:
authorized_user = AdminUser.authenticate(params[:username], params[:password])
session[:user_id] = authorized_user.id
session[:username] = authorized_user.username
flash[:notice] = "You are now logged in."
redirect_to(:action => 'menu')
flash[:notice] = "Invalid username/password combination."
redirect_to(:action => 'login')
I don't know if there is an error in there that I am missing?
Anyway thanks in advance, and let me know if you need more of my code to find a solution because I am totally stuck at this point.