Question

I am making a new mountable engine. It is a part of a bigger application. I am trying to use the layout of another small engine as my engine and that engine need to have same layout. For this purpose my aaplication controller looks like :

class ApplicationController < AnotherEngine::ApplicationController
     layout "AnotherEngine/AnotherEngine"    #Pointing to the layout file of other engine
end

Now the problem is that there are named_paths in the other engine which my engine is not able to recognise and throws

ActionView::Template::Error (undefined local variable or method `some_path' for #<#<Class:0xbbd9524>:0xbbf85c8>)

Why is the application not able to find the paths? When I go to the other engine all works fine, but when my engine tries to use the layout of the other engine, which in turn has some named paths, I get these errors.

Was it helpful?

Solution

The routes should be in the dorm of engine_name.named_path !! It will work like a charm :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top