【发布时间】:2014-09-01 08:41:35
【问题描述】:
我确实在 localhost:3000 上使用确认电子邮件进行了注册。在我的 development.rb 我这样添加
config.action_mailer.default_url_options = {:host => 'localhost:3000'}
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => 'smtp.gmail.com',
:port => '587',
:authentication => :plain,
:user_name => 'myemail@gmail.com',
:password => 'mypassword',
:domain => 'localhost:3000',
:enable_starttls_auto => true
}
当我已经注册时,我打开我的电子邮件,然后在收件箱中显示消息您可以通过以下链接确认您的帐户电子邮件:确认我的帐户我点击此链接。它重定向到 localhost:3000/users/sign_in 并且我可以成功登录。但是当我再次单击收件箱中的此链接(确认我的帐户)时。它显示如下错误:
在网址中:http://localhost:3000/users/confirmation?confirmation_token=dWUeHVP_N7VzsVwvkNW5
消息错误:
Resend confirmation instructions
1 error prohibited this user from being saved:
Confirmation token is invalid
在我的电子邮件收件箱中,当我再次单击“确认我的帐户”链接时,我希望它重定向到 localhost:3000/users/sign_in。再次单击“确认我的帐户”链接时,如何重定向到 localhost:3000/users/sign_in ?请帮帮我!
【问题讨论】:
-
你在用设计吗?
-
是的,我正在使用设计
标签: ruby-on-rails ruby-on-rails-4