未定义方法“new_confirmation_path”确认模块装置+蒙戈ID
我正在尝试使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您在安装 devise + mongoid + 时出现此问题:可确认模块:
!!您必须重新启动服务器¡
步骤如下:
当您安装了 devise + mongoid + 后:
1º 启用
:用户模型中的可确认
模块2° 运行命令:
3° 重新启动 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 Model2º run the command:
3º Restart the rails server
Regards!