I'm new to rails and was trying to get a handle on Devise. I'm
following the Packt Pub - Learning Devise For Rails tutorial and have a
problem around pg 19-20 (CH2). I've created a user, logged out, but
when I try to login again I get this error:
NameError in Devise::SessionsController#create
undefined local variable or method `signin' for
#<Class:0x00000004352b00>
I was confused because I see "Sessions Controller" in the error, but the
code lists is in my devise user model:
class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
attr_accessor :signin
validates :username, :uniqueness => {:case_sensitive => false}
def self.find_first_by_auth_conditions(warden_conditions)
conditions = warden_conditions.dup
where(conditions).where(["lower(username) = :value
OR lower(email) = :value", { :value => signin.downcase }]).first
end
end
Here's a link to everything I have so far:
https://github.com/GBressler/Learning-Devise-for-Rails/tree/master/Ch2/first_app_extensions
The tutorial:
https://www.packtpub.com/application-development/learning-devise-rails
Any help that could be provided would be greatly appreciated!
Attachments:
http://www.ruby-forum.com/attachment/10847/Screenshot_from_2015-06-08_22_52_49.jpg
--
Posted via
http://www.ruby-forum.com/.