undefined方法`new_confirmation_path'确认模块设计+ MongoID

hyp*_*jas 12 views ruby-on-rails devise mongoid

我正在尝试使用Rails 3.1 +设计模块:使用此模板确认 + MongoID:

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

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

rails generate devise:视图可确认

生成这个:

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
Run Code Online (Sandbox Code Playgroud)

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

Devise/sessions中的NoMethodError #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' %>
Run Code Online (Sandbox Code Playgroud)

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

hyp*_*jas 48

如果在安装devise + mongoid +时遇到此问题:可验证模块:

!!你必须重启服务器

步骤是:

当你安装了devise + mongoid后:

:confirmable用户模型中的1º启用模块

2º运行命令:

rails generate devise:views confirmable 
Run Code Online (Sandbox Code Playgroud)

重启rails服务器

问候!

  • 重启服务器,重启服务器,你觉得我是傻瓜?我是.经验丰富的是,当您一次又一次地做出错误时,您会认出错误 (4认同)