0
I am trying to use the authenticate method and the Rails returns Nomethoderror: Undefined method `authenticate' for #.
My controller: class Sessionscontroller < Applicationcontroller #include Sessionshelper
def login
render 'admin/login'
end
def create
user = User.where(:email => params[:session][:email].downcase).first
if user && user.authenticate(params[:session][:password])
#log_in user
redirect_to :controller => 'admin', :action => 'index'
else
flash[:danger] = "Email ou senha inválido"
render 'login'
end
end
end
I tried to do also by the Rails console and returns the same error. When trying to list the object methods by the console it returns an entire unorganized list "user.methods?" I can’t find my mistake.
Detail have installed bcrypt (3.1.11) bcrypt-ruby (3.1.5)
– mluiz