I’m trying to do the login section for my small web application, but it
doesn’t seem to work like I want.
Here is the Controller:
@user = User.authenticate(params[:user][:email],
redirect_to :action => ‘my_account’
This is how the model authenticate look like.
def self.authenticate(email, password)
@user = User.find( :first,
:conditions => [“email = ? and password = ?”, email,
:limit => 1);
return false if @user.nil?
return true if @user
But whenever I try to login I get a error
undefined method `email’ for false:FalseClass
I don’t know what this one means? could anyone help me and Thanks for