-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
Does not work with '-' or '/' in named route #25
Comments
I found the problem: If you omit ":as => :something", i18n_routing will try to use the path as a function name. Which usually fails, because the path contains characters not allowed in function names, like '/', ':', '-', etc. If I add unique :as parameters to all my routes, then it seems to work. |
Hmm, I think you can't do it in rails itself apparently, so it will not be You are welcome :) 2011/10/4 jensb <
|
The above example was just an example. :) For SEO purposes we don't use '/' because words after '/' will be interpreted as having a lower priority / hierarchy by search engines, which is not the case here (all words in the URL have the same priority).
Your plugin works if I add ":as => ..." names to each route (which I don't have to do otherwise); and use the routes themselves in the YML file as lookup keys, instead of the route names, as in
For easier route maintenance, I would have preferred something like
because that would allow updating of the route in routes.rb without having to change all keys in the translations. Is it possible to add this feature? Also, I would like to use ERB blocks in the locales file (because some of my routes in routes.rb are also created within loops). Would it be possible to add this feature? |
Given this route:
i18n_routing will throw an error
I suspect this is because I am using different parameter separators than the default '/' and '.' (for SEO optimization).
How would I be able use this plugin in combination with such routes?
Thanks!
The text was updated successfully, but these errors were encountered: