注册用户时未定义的局部变量或方法“unconfirmed_email"? [英] Undefined local variable or method `unconfirmed_email' when registering users?

查看:9
本文介绍了注册用户时未定义的局部变量或方法“unconfirmed_email"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在我的应用程序中安装了 Devise,配置了视图和所有内容.但是,当我单击注册按钮时,出现此错误:

I just installed Devise in my app, configured the views and everything. However, when I click the sign up button I get this error:

NameError in Devise::RegistrationsController#create
undefined local variable or method `unconfirmed_email' for #<User:0x00000103721b28>

这是为什么?另外,我正在使用 tlsmail 通过我的 gmail 企业帐户发送电子邮件.这也可能是个问题.

Why is this? Also, I'm using tlsmail to send emails out through my gmail business account. This might be a problem as well.

推荐答案

unconfirmed_email 需要重新确认.出于某种原因,这是在 config/intializers/devise.rb 中默认启用的:

unconfirmed_email is required for reconfirmable. For some reason this was enabled by default in config/intializers/devise.rb:

config.reconfirmable = true

您所要做的就是将其设置为 false.

All you have to do is set this to false.

这篇关于注册用户时未定义的局部变量或方法“unconfirmed_email"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆