8

Here I want to render the layout of engine's parent application, i.e. in hierarchy engine's parent application.html.erb should be higher. But since engine has also got application.html.erb it is only rendering it and not rendering engine's parent application.html.erb.

How can i render my parent application.html.erb along with my engine application.html.erb

Thanks

4

1 回答 1

14

In your engine controller you can use:

layout 'application'

in order to render the application layout or you can switch to:

layout 'engine_name/application'

to load the engine's layout.

I don't know if you can load them both (engine layout should only inherit from application layout and extend it) but I hope it gets you further at least.

于 2012-07-20T20:58:12.657 回答