I have a Rails Engine that I'd like to share a layout from the container application. I'd like to support all the URL helpers from the main app's layout(s) to make integration trivial. That is to support layouts with helpers from the container app:
= link_to "Signup", new_user_path
= link_to "Login", new_user_path
...
This causes:
undefined local variable or method `new_user_path' for #<#:0x007f9bf9a4a168>
I can fix it by changing the application.html (in the container app) to:
= link_to "Signup", main_app.new_user_path
= link_to "Login", main_app.new_user_path
But the goal is to make it so integrating the engine doesn't require users to make changes to the existing functioning application.html.
I believe I can also fix the errors by removing isolate_namespace Example from lib/example/engine.rb, but that breaks nearly everything in the engine.
Any way to allow container app helpers and explicitly namespace my engines helpers to avoid conflict? (i.e. using example.root_path instead of root_path)?