-
Notifications
You must be signed in to change notification settings - Fork 143
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
Putting an engine in a localized block breaks engine routing method #166
Comments
I worked around this adding a method to the application helper like this, but it does not feel right:
|
Refers to #154? |
I think so. I remember that discussion. It also had to do with #123 (which was openend by me too ;) ) |
I'm running into the next problem, even with the "hack" I posted above, the generated urls are missing the locale for the main_app if any engines are mounted at '/'. Example:
force_locale is set to true in that example, but it does not seem to matter. |
Feel free to submit a PR or start a wiki page explaining the limitation with engines |
The current engine implementation is buggy and incomplete. We are going to drop the whole feature, waiting for a new contributor Fixes enriclluelles#166, fixes enriclluelles#172, fixes enriclluelles#173 and fixes enriclluelles#178
I had the same problem, that my engine routing proxy was not available anymore and I think I've found a better solution to just add it in an Rails.application.routes.mounted_helpers.class_eval do
def blorgh
public_send("blorgh_#{I18n.locale}")
end
end so this is really everywhere accessible where Maybe |
I'm not using Route Translator in production in any of my current projects, so a PR with tests and documentation would be very welcomed PS: because of this issue, I have a development branch where the engine feature has been completely removed |
Relevant commit: f70f6f7 Commit message
|
Release 10.0 will still have engine support |
I tried, but was not able to write a failing test at the top of the current master. |
Assume you have an engine called Blorgh. And you mount it like this:
It is now impossible to call
blorgh.unicorns_path
in a view. Instead of this you have to append the locale like this:blorgh_en.unicorns_path
I'm on rails 5.0/5.1 and ruby 2.3.x and 2.4.1 and route translator 5.4.0.
Any clues how to fix this?
Thanks in advance!
Bes tregards
Roberto
The text was updated successfully, but these errors were encountered: