Rails engine: display parent application

Here I want to display the layout of the engine’s parent application, that is, in the engine parent application.html.erb hierarchy should be higher. But since the engine also received application.html.erb, it only renders it and does not return the parent file engine.html.erb.

How can I create a parent application.html.erb along with my application.html.erb engine

thanks

+7
source share
1 answer

In your motor controller you can use:

layout 'application' 

to display the application layout or you can switch to:

 layout 'engine_name/application' 

to load the engine layout.

I don’t know if you can download both of them (the engine layout should only inherit from the application layout and expand it), but I hope that it suits you at least.

+10
source

All Articles