使用Rails 3.1引擎时如何引用现有路由?

时间:2011-07-26 23:09:37

标签: routes ruby-on-rails-3.1 rails-engines

我在Rails 3.1中使用forem引擎,但我的应用程序布局引用了一些资源路由,例如users_pathnew_sprite_path

这一切都在引擎外工作正常,但是当我尝试导航到引擎中的页面时我得到了

undefined local variable or method `new_sprite_path' for #<#<Class:0x7f4faa4f9240>:0x7f4faa4dc320>

如何让引擎正确查看我的应用程序中的路径?

1 个答案:

答案 0 :(得分:5)

使用main_app.new_sprite_path