【发布时间】:2013-11-20 16:34:01
【问题描述】:
我使用已启用确认的设计 (3.1.1)。
第一期
confirmation_url 不像预期的那样
我的/app/views/devise/mailer/confirmation_instructions.html.erb 包含
<p><%= link_to 'confirm', confirmation_url(@resource, :confirmation_token => @token) %></p>
预期是:
http://localhost:3000/?confirm/confirmation_token=3DXF7mw4KcJxtD698coCdH
但我得到了
?confirmation_token=3DXF7mw4KcJxtD698coCdH
出现这个错误
Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true
第二期
令牌不匹配
confirmation_token.invalid
但我有
config.action_controller.default_url_options = {host: 'localhost', port: 3000}
在test.rb 和development.rb:
【问题讨论】:
标签: ruby-on-rails devise ruby-on-rails-3.2 devise-confirmable