使用Devise将可确认模块添加到现有站点

sly*_*hic 6 authentication ruby-on-rails registration confirmation devise

我正在使用设计用于Web应用程序,并希望将可确认模块添加到站点.但是,由于未生成确认_token,用户无法登录.点击"未收到确认说明?" 链接令牌仍然没有生成.

确认电子邮件只会生成此链接(请注意网址中缺少令牌):

<p><a href="http://localhost:3000/users/confirmation">Confirm my account</a></p>
Run Code Online (Sandbox Code Playgroud)

让这个工作的最佳方法是什么?

非常感谢,
托尼

Jad*_*ade 9

我正在寻找同样的答案.我怀疑答案可能是数据模型包括每个用户是否得到确认.它似乎补充说:

confirmation_token, confirmed_at, confirmation_sent_at

此外,可确认模块似乎添加了以下方法:

:confirmation_token,:confirmation_token =,:confirmation_token ?,:confirmation_token_change,:confirmation_token_changed ?,:confirmation_token_was,:reset_confirmation_token!:confirmed_at,:confirmed_at =,:confirmed_at ?,:confirmed_at_change,:confirmed_at_changed ?,:confirmed_at_was,:reset_confirmed_at! :confirmation_sent_at,:confirmation_sent_at =,:confirmation_sent_at?:confirmation_sent_at_change,:confirmation_sent_at_changed?:confirmation_sent_at_was,:reset_confirmation_sent_at!

所以你可以在数据模型层中完成它.我正在使用Mongoid,所以我只写了一个脚本,将每个用户的confirmed_at更改为今天.