2011-09-30 51 views
10

我試圖使用Rails 3.1 +工作設計模塊:可證實 + MongoID與此模板:未定義的方法`new_confirmation_path」確認模塊設計+ MongoID

https://github.com/RailsApps/rails3 - 應用模板/生/主/ Rails3中-mongoid-色器件,template.rb

彌模板工作正常,但現在我已經生成的下一個命令確認的觀點:

軌產生色器件:意見的conf irmable

生成此:

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 

我趕上下一個錯誤刷新頁面:

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 ...等頁面?

+5

現在正在工作:D。 對於每個人安裝的時候闕有這個問題,色器件+ mongoid +:可確定模塊的問題是,!!你必須重新啓動server¡¡ 的步驟是: 當你已經安裝了色器件+ mongoid則: 1º啓用:在您的用戶模型 可證實模塊2º執行的是命令:**軌產生色器件:觀點可證實** 3º重新啓動服務器導軌 瞧!非常感謝你 – hyperrjas

回答

43

如果您安裝了此問題時色器件+ mongoid +:可確定模塊:

!!你必須重新啓動server¡¡

的步驟是:

當您安裝設計+ mongoid則:

1º使:confirmable模塊在用戶模型

2º運行命令:

rails generate devise:views confirmable 

重新啓動Rails服務器

商祺!

+1

是的,重啓服務器對我來說工作完美= D – jtompl

+3

重啓服務器,重啓服務器,你以爲我很笨?對,我是。經驗是如果你認識到你的錯誤,當你一次又一次地做出 – halfbit

+0

哈哈是的,我也是愚蠢的!無論如何,或者懶惰。所以懶惰我擡起頭來,而不是花幾秒鐘思考它:) – micapam

相關問題