我使用了devise 2.2.4
,在登录页remember_me
选项无效。它也没有抛出任何错误,也没有在remember_at
表的user
字段中保存任何内容。
class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :token_authenticatable, :confirmable,
# :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,:token_authenticatable,:recoverable, :rememberable, :trackable, :validatable#,:authentication_keys => [:login]
# Setup accessible (or protected) attributes for your model
attr_accessible :email, :password, :password_confirmation, :remember_me, :username, :dealer_detail_id
validates :username, :password, :password_confirmation, :presence => true
validates_uniqueness_of :username #, :if => :email_changed?
end