【问题标题】:Confirmation token can't be blank确认令牌不能为空
【发布时间】:2014-02-19 08:29:00
【问题描述】:

早些时候我得到 - 找不到令牌。在进行更改后建议 here 我收到这个新错误

确认令牌不能为空。

使用导轨 - 3.0.6 设计 - 1.1.3 红宝石 - 1.9.3

几个小时以来一直在敲我的头,我仍然不知道为什么没有收到令牌。这仅在用户单击通过邮件发送的确认链接后才会发生。任何指针我应该做什么。请帮忙,在此先感谢。

用户模型

class User < ActiveRecord::Base
  # TODO:  Remove talent_seeker from here, set manually on creation
  # Setup accessible (or protected) attributes for your model
  attr_accessible :email, :password, :password_confirmation, :first_name, :last_name, :disabled,
    :job_title, :company_name, :city, :state, :zip, :public_profile, :willing_to_relocate, :avatar, :resume, 
    :remove_avatar, :remove_resume, :html_resume_attributes, :upload_in_progress, :rb_resume

结束

【问题讨论】:

  • 现有用户或新创建的用户是否收到此错误?
  • 这是一个客户端应用程序,我只是在本地托管,还没有用户。
  • 能否请您发布用户模型?或者如果你不能,检查是否有任何回调试图以某种方式保存模型?
  • 是否有可能覆盖 Devise ConfirmationsController?
  • 还没有看到这样的

标签: ruby-on-rails ruby ruby-on-rails-3 devise mysql2


【解决方案1】:

由于设计版本不兼容,您无法应用您提到的问题的解决方案。只需将 app/views/&lt;user&gt;/mailer/confirmation_instructions.html.erb 中的最后一行替换为以下行

<p><%= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @resource.confirmation_token) %></p>

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2013-07-26
  • 2021-04-15
  • 1970-01-01
  • 2020-02-26
  • 1970-01-01
  • 2019-05-24
  • 2014-01-27
  • 2018-02-21
相关资源
最近更新 更多