使用自定义设计视图和控制器的炼油厂cms

时间:2012-11-22 17:22:01

标签: ruby-on-rails ruby ruby-on-rails-3 devise refinerycms

我在我的Rails 3.2.8应用中使用了refinery_cms。它配置正确,它也正常工作。但是现在我想明确地实现我所有的设计视图和控制器,因为我将稍微修改它们。

因此我遵循了这篇文章

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

完成上述文章中提到的所有配置后,我收到以下错误,我无法跟踪根本原因:

这是错误:

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

当我从routes.rb中删除以下行时发生上述错误:

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

但如果我保留上述内容并访问页面http://localhost:3000/user/sign_up,我会收到以下错误:

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

对此的任何想法都会非常有用

2 个答案:

答案 0 :(得分:0)

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

  • 根据the guide编写装​​饰器,为现有设计控制器添加新功能(我猜你知道Refinery也依赖于Devise gem)。
  • 将所有其他功能作为可安装引擎,在this Railscast或任何其他来源中解释,与Rails 3中的引擎相关。

答案 1 :(得分: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.

希望这一切都有意义。

感谢。