前
网址:
http://example.com/users/confirmation?confirmation_token=jevYKv1z9Pr1LsAUB2NX
应用程序/视图/设计/邮件/ confirmation_instructions.html.erb:
<p><%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %></p>
后
配置/ routes.rb中:
devise_scope :user do
get 'confirm/:confirmation_token', to: 'devise/confirmations#show'
end
应用/视图/设计/邮寄者/ confirmation_instructions.html。ERB:
<p><%= link_to 'Confirm my acount', confirm_url(@token) %></p>
网址:
http://example.com/confirm/Kezap1iutgvXyQAhyu64
我应该做哪些改变,如果我希望用户被重定向到生产HTTPS? – 2014-02-22 07:14:05
我现在发送的链接是http,并且用户也获取他的令牌,但由于该应用托管在https上,因此它无法识别令牌: – 2014-02-22 07:15:00
设计3更新:设计现在使用一个较短的标记,然后在比较数据库之前进行散列。您的邮件链接应该如下所示:'link_to'确认我的帐户',confirmation_url(@resource,confirmation_token:@token)' – steakchaser 2014-12-30 19:07:27