Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 如何配置设计,使用户注册后即使没有确认电子邮件通过电子邮件链接登录?_Ruby On Rails_Ruby_Devise - Fatal编程技术网

Ruby on rails 如何配置设计,使用户注册后即使没有确认电子邮件通过电子邮件链接登录?

Ruby on rails 如何配置设计,使用户注册后即使没有确认电子邮件通过电子邮件链接登录?,ruby-on-rails,ruby,devise,Ruby On Rails,Ruby,Devise,我使用Desive(2.0.4)设置用户注册和登录功能。现在我想让用户能够在注册后登录。向他的邮箱发送确认电子邮件。只需标记“此用户未确认”。如何配置?尝试将覆盖的方法确认\u所需?直接添加到您的用户模型: class User < ActiveRecord::Base ... def confirmation_required? false end end class用户

我使用Desive(2.0.4)设置用户注册和登录功能。现在我想让用户能够在注册后登录。向他的邮箱发送确认电子邮件。只需标记“此用户未确认”。如何配置?

尝试将覆盖的方法
确认\u所需?
直接添加到您的用户模型:

class User < ActiveRecord::Base
  ...

  def confirmation_required?
    false
  end
end
class用户
我发现这也能解决问题。选择哪一个

def active_for_authentication?
  true
end

这是正确的答案。覆盖
确认\u required?
将使可确认无法工作(未发送电子邮件)
active\u for\u authentication?
是如何用“特殊条件”覆盖用户,并由confirmable实际使用。