使用devise rails3记住我的选项

时间:2013-07-29 13:35:46

标签: ruby-on-rails-3 devise remember-me

我使用了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

0 个答案:

没有答案