加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – 未定义的方法`new_confirmation_path’确认模

发布时间:2020-12-16 22:37:49 所属栏目:百科 来源:网络整理
导读:我正在尝试使用Rails 3.1 Devise Module:使用此模板确认MongoID: https://github.com/RailsApps/rails3-application-templates/raw/master/rails3-mongoid-devise-template.rb Mi模板工作正常,但现在我已经使用下一个命令生成可确认的视图: rails生成设计
我正在尝试使用Rails 3.1 Devise Module:使用此模板确认MongoID:

https://github.com/RailsApps/rails3-application-templates/raw/master/rails3-mongoid-devise-template.rb

Mi模板工作正常,但现在我已经使用下一个命令生成可确认的视图:

rails生成设计:视图可确认

生成这个:

invoke  Devise::Generators::SharedViewsGenerator
  create    app/views/confirmable/mailer
  create    app/views/confirmable/mailer/confirmation_instructions.html.erb
  create    app/views/confirmable/mailer/reset_password_instructions.html.erb
  create    app/views/confirmable/mailer/unlock_instructions.html.erb
  create    app/views/confirmable/shared
  create    app/views/confirmable/shared/_links.erb
  invoke  form_for
  create    app/views/confirmable/confirmations
  create    app/views/confirmable/confirmations/new.html.erb
  create    app/views/confirmable/passwords
  create    app/views/confirmable/passwords/edit.html.erb
  create    app/views/confirmable/passwords/new.html.erb
  create    app/views/confirmable/registrations
  create    app/views/confirmable/registrations/edit.html.erb
  create    app/views/confirmable/registrations/new.html.erb
  create    app/views/confirmable/sessions
  create    app/views/confirmable/sessions/new.html.erb
  create    app/views/confirmable/unlocks
  create    app/views/confirmable/unlocks/new.html.erb

我抓住下一个错误刷新页面:

Devise中的NoMethodError / sessions#new

undefined method `new_confirmation_path' for #<#<Class:0xb94bb04>:0xb948b20>

11: <% end -%>
12: 
13: <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
14:   <%= link_to "Didn't receive confirmation instructions?",new_confirmation_path(resource_name) %><br />
15: <% end -%>
16: 
17: <%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email)     && controller_name != 'unlocks' %>

为什么不使用我的登录名,sign_up …等页面?

解决方法

对于每个人都有这个问题,当安装设备mongoid:确认模块的问题是这样的

!!你必须重启服务器

步骤是:

当你已经安装了设计mongoid然后:

1o启用:用户模型中的可确认模块

2oexec命令:

rails generate devise:views confirmable

3o重新启动服务器导轨Voila!

非常感谢你 –

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读