Hiya - before I start let me tell you i’m a Nuby on Rails.
I’ve created a user registration within my application that requires
email validation and that seems to be working fine.
I’m now creating the user login page and have the following code in my
UsersController:
def login
@user = User.new
@user.username = params[:username]
end
def process_login
if user = User.authenticate(params[:user])
session[:id] = user.id # Remember the user’s id during this
session
redirect_to session[:return_to] || ‘/’
else
flash[:error] = ‘Invalid login.’
redirect_to :action => ‘login’, :username =>
params[:user][:username]
end
end
def logout
reset_session
flash[:message] = ‘You are now logged out.’
redirect_to :action => ‘login’
end
I’ve attempted to login using a validated account that I set up but
can’t seem to get passed the process_login.
It doesn’t seem to attempt to ‘authenticate’. I’m just seeing
process_login.rhtml. Is there something missing in my code?
Cheers
Craig