1

I have used refinery_cms with my Rails 3.2.8 app. It is configured correctly and it is also working fine. But now I want to implement all my devise views and controllers explicitly as I will be modifying them a bit.

So for that I followed this article

http://sdownie.com/blogs/integrating-refinery-rails-3-2-into-your-existing-rails-app

After doing all the configuration mentioned in the above article, I am getting the following error and I have difficulty tracking the root cause:

This is the error:

undefined method `refinery' for #<#<Class:0xcdec518>:0xcdd4fd0>

The above error occurs when I am removing the following line from routes.rb:

mount Refinery::Core::Engine, :at => '/'

But if I am keeping the above line and visiting the page http://localhost:3000/user/sign_up , I'm getting the following error:

undefined method `user_registration_path' for # <ActionDispatch::Routing::RoutesProxy:0xe189634>

Any idea on this will be really helpful

4

2 回答 2

0

看来您正试图在现有的 Refinery 应用程序中添加一些控制器和视图,而不是将炼油厂集成到现有的普通应用程序中。在这种情况下,有几种可能性:

  • 根据指南,通过编写装饰器向现有设计控制器添加新功能(我猜你知道炼油厂也依赖于设计宝石)
  • 将所有其他功能作为可安装引擎,在此 Railscast或任何其他来源中解释,与 Rails 3 中的引擎相关。
于 2012-11-22T21:34:09.820 回答
0

大家好,这是一个传统的问题解决方案非常简单,请按照以下步骤操作。

(1)rake generate devise:views

(2)append "user" before helper urls for example if there is a helper url used in rails   forms

**new_registration_path** then update it as **new_user_registration_path** 

 Similarly whenever you get the same error then go to app/views/devise/ respective     template and check the url used there where error comes and update it as we updated above.

希望这一切都有意义。

谢谢。

于 2013-01-30T12:54:01.470 回答