RoR 3.2设计(3.2.2):超时无效

时间:2014-11-05 12:54:51

标签: ruby-on-rails devise ruby-on-rails-3.2

检查了几个问题之后:

rails 3.1, devise gem, :timeoutable is not working, why?

Devise - Timeout not working

devise config.timeout_in not working

How to configure time out using devise?

我已将用户模型设置为:timeoutable

class User < ActiveRecord::Base
devise :rememberable, :demo_authenticatable, :api_authenticatable,:registerable,
:recoverable, :trackable, :validatable, :confirmable, :lockable, :timeoutable

我还在devise.rb文件中取消了timeout_in行

config.timeout_in = 1.minutes

我也尝试在用户模型中设置timeout_in属性,但我一直在登录

任何线索?

提前致谢,欢呼!

1 个答案:

答案 0 :(得分:2)

如果您希望在刷新时向您显示登录页面,请从模型中删除超时部分并将其放入devise.rb NOT development.rb&amp;重启rails服务器。 config.timeout_in = 1.hour