2
我正在制作一个新的可安装引擎。 它是更大应用程序的一部分。 我想使用另一个小引擎的布局作为我的引擎,并且该引擎需要具有相同的布局。 为此我aaplication控制器的样子:从另一个可安装引擎访问一个Mountable引擎的路由
class ApplicationController < AnotherEngine::ApplicationController
layout "AnotherEngine/AnotherEngine" #Pointing to the layout file of other engine
end
现在的问题是,有在其他引擎,它不是我的引擎能够识别并引发named_paths
ActionView::Template::Error (undefined local variable or method `some_path' for #<#<Class:0xbbd9524>:0xbbf85c8>)
为什么应用无法找到路径? 当我去其他引擎都工作正常,但是当我的引擎试图使用其他引擎的布局,而其他引擎又有一些命名路径,我得到这些错误。