RailsCasts Pro episodes are now free!

Learn more or hide this

mgmacri's Profile

GitHub User: mgmacri

Comments by

Avatar
Solution
  def self.authenticate(email, password)
    find_by_email(email).try(:authenticate, password)
  end
Avatar

Upon login I get the following error returned:

NoMethodError in SessionsController#create

undefined method `authenticate' for #Class:0xb69d4638

ruby /user.rb
  class User < ActiveRecord::Base
  has_secure_password

  attr_accessible :email, :password_digest, :password, :password_confirmation

  validates_uniqueness_of :email
end

Any suggestions?