-
-
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
Rails 4.0 compatibility #43
Comments
+1, rails 4.0.0.rc1 |
Check out the rails4 branch in my fork here: https://github.com/ncri/i18n_routing/tree/rails4 As a starting point. No more errors, but not sure if it works properly yet. |
Hey @ncri, it fixed the previous error (
|
Just use the Rails 4 branch of my fork, it works (for me ;-) |
Thanks @ncri 👍 – looking forward to try that out. |
Actually it didn't work for me. But since I had to open up Journey's source and add an extra |
Could someone propose a solution for master? tirsdag den 2. juli 2013 skrev Arthur Corenzan :
|
I can make a pull request for master soon. until then, you can simply use my rails4 fork. @haggen: did you use the rails4 branch in my repo, or master? do you have a stacktrace for the error? |
Thanks very much – that would be great. |
Oops, @haggen, the stack trace was there already, my mistake. Did you only had to fix that one issue? |
@haggen I have the same problem |
Can you test if adding |
I have a problem with i18n localized routes.
and here is the route
is there any solution for this situation? I'm using ncri's i18n_routing gem.
|
require 'action_dispatch/journey/nodes/node' don't fix the problem :S |
@mehmetemininac: I'm only using i18n routing for resource routes, not for named routes, as i had many issues with those. So I didn't test my branch with named routes. @willywg: so you still get exactly the same error? can you make a minimla testapp available on github that reproduces the issue? |
@ncri I put require 'action_dispatch/journey' on the top of i18n_routing_rails4.rb and fix my problem. |
Everyone: for me the gem 'route_translator' works out of the box with the same configuration of i18n_routing. It seems better supported too. |
@tilsammans Does the route_translator gem also work without having the locale in the URL? |
Yes. I had to set the available locales to just the one I want to support, because otherwise there were many routes generated with unused locales. Example, in # Limit available locales to the ones actually in use.
# Mostly limits the number of routes generated.
I18n.available_locales = [:nl] Also the translations are under a different namespace, they are now all under "routes". |
Okay, what happens if you have more than one, e.g. four? |
I don't know, try it out yourself. 🐱 |
@willywg's |
(cc @ncri) |
Added |
Thanks 😊 |
Does it works on Rails 4? If so, the README should be updated. |
@negarnil Check out #43 (comment) for details. It's not in master yet. It works ok, but not optimal – for me anyway. |
Yes, i believe my fork still needs some work, but for us it does all we need so far... A bit off topic: To be honest the codebase of this gem is well, slightly messy. :) Huge methods that are hard to debug and maintain... No offence to the creator, it is an incredibly useful gem and there are not many alternatives out there, so thanks for making it! In my opinion we need route translation in the rails core though... |
@ncri, I agree. I think your fork is fine – the problem is the base, IMO. I'd really like to make a replacement for it, but I just don't know anything about the router internals. But there must be a better solution – none of the current ones work great. Yeah, I don't understand why it's not in Rails core – @dhh, do you have a comment? |
Hello! I'm getting this error:
on this route:
Anyone else having the same problem? Using @ncri's fork. |
mehmetemininac has the same error. I haven't looked into making the rails 4 fork work with named routes as I even had troubles getting those working correctly with the rails 3 branch. So, only resource routes work for now. |
Ah, I understand! Thanks for the quick reply. |
@ncri I have resolved the |
You could either create a new pull request and copy my code over or, maybe easier, just fork my fork and create a pull request there: https://github.com/ncri/i18n_routing/tree/master |
Great plugin. But it doesn't work in the newly released Rails 4.0.0.beta1:
Thanks.
The text was updated successfully, but these errors were encountered: