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
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
What is this attar_accessor supposed to do? Do you set it to a value at any point? This is not a part of Devise, as far as I can tell.
I don’t know the dynamics of Devise, but I looked at your application:
2 controllers: application and home. home has show, new, edit defs. All empty
1 model user
3 view folders: devise, home, layouts.
Devise has folder session with new.html.erb. It has:
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>