Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unisolate the namespace #132

Merged
merged 6 commits into from
Nov 14, 2018
Merged

Unisolate the namespace #132

merged 6 commits into from
Nov 14, 2018

Conversation

jpowell
Copy link
Member

@jpowell jpowell commented Nov 13, 2018

https://guides.rubyonrails.org/engines.html#routes

If you look at the engines docs for rails, the recommended implementation for an engine is to specify isolate_namespace SomeEngineName. There is a subtlety that requires you to specify main_app.url_helper_x in any view or partial that is rendered by engine machinery... we felt as if the gem should handle the heavy lifting and not require the client application to know that the engine has such nuances. This requires you to specify the namespace in places like routes, controller references, view paths, etc -- in the gem. See subtle paragraph that took some time to find(from the doc above):

If a template rendered from within an engine attempts to use one of the application’s routing helper methods, it may result in an undefined method call. If you encounter such an issue, ensure that you’re not attempting to call the application’s routing methods without the main_app prefix from within the engine.

@jpowell jpowell changed the title Unisolate the namespace [WIP] Unisolate the namespace Nov 13, 2018
@watermarkchurch-bot
Copy link

1 Message
📖 PR is classed as Work in Progress

Generated by 🚫 Danger

@coveralls
Copy link

coveralls commented Nov 13, 2018

Coverage Status

Coverage decreased (-0.01%) to 94.884% when pulling 0e7177a on unisolate into 6b9ec95 on master.

@jpowell jpowell changed the title [WIP] Unisolate the namespace Unisolate the namespace Nov 14, 2018
@jpowell jpowell merged commit e7d27ef into master Nov 14, 2018
@jpowell jpowell deleted the unisolate branch November 14, 2018 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants