未定义方法“new_confirmation_path”确认模块装置+蒙戈ID

发布于 2024-12-07 04:30:44 字数 2075 浏览 0 评论 0原文

我正在尝试使用 Rails 3.1 + Devise 模块 :confirmable + MongoID 使用此模板:

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

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

railsgenerate devise:viewsconfirmable

生成此:

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

I捕获下一个错误以刷新页面:

Devise/sessions#new 中的NoMethodError

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...等页面无法工作?

I am trying to work with Rails 3.1 + Devise Module :confirmable + MongoID with this template:

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

Mi template working fine but now I have generate confirmable views with the next command:

rails generate devise:views confirmable

Generate this:

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

I catch the next error to refresh the page:

NoMethodError in Devise/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' %>

Why not working my login, sign_up...etc pages?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

紙鸢 2024-12-14 04:30:44

如果您在安装 devise + mongoid + 时出现此问题:可确认模块:

!!您必须重新启动服务器¡

步骤如下:

当您安装了 devise + mongoid + 后:

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

2° 运行命令:

rails generate devise:views confirmable 

重新启动 Rails 服务器

问候!

If you have this problem when installed devise + mongoid + :confirmable module:

!!You must restart the server¡¡

The steps are:

When you have installed devise + mongoid then:

1º enable :confirmable module in your User Model

2º run the command:

rails generate devise:views confirmable 

Restart the rails server

Regards!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文