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

Rails 4 compatibility #42

Open
ghost opened this issue Mar 7, 2013 · 14 comments
Open

Rails 4 compatibility #42

ghost opened this issue Mar 7, 2013 · 14 comments

Comments

@ghost
Copy link

ghost commented Mar 7, 2013

Looks like the gem doesnt work. Routes were translated but _path helpers doesnt work.

@sarjanen
Copy link

Someone who has come up with a solution for this?

@overallduka
Copy link

This is a big problem, here meet dont work whit Rails 4, someone have solution ?

@ghost
Copy link
Author

ghost commented Aug 5, 2013

same issue... actually too bad , cannot upgrade any of y Rails 3 apps... all using translated routes ...
any idea where we should look at in the code ??

@ghost
Copy link
Author

ghost commented Sep 11, 2013

found a way to make it running w Rails 4, using send...
I changed all my path urls
portofolio_path( Portfolio.find_by_name('ceramics') )
to :
send("portfolio_#{I18n.locale}_path", Portfolio.find_by_name('ceramics')
obvioulsy I did it because I need to upgrade an existing app.... I'll try to avoid this gem in future localized apps

@dgilperez
Copy link

+1

Is this gem still supported?

@GSI
Copy link

GSI commented Oct 6, 2013

+1

Note that I am trying to migrate to route_translator (http://github.com/enriclluelles/route_translator). It seems to work in production, but in test any _path or _url calls without explicit language code also cause NoMethodError: undefined method 'foo_path' ...

I'll keep you updated.

@acevedoma
Copy link

+1

2 similar comments
@jdurand
Copy link

jdurand commented Dec 3, 2013

+1

@ghost
Copy link
Author

ghost commented Dec 21, 2013

+1

@GSI
Copy link

GSI commented Jan 22, 2014

Error still persists in Rails 4.0.2.

GSI pushed a commit to GSI/rails-translate-routes_reproduce_issue-42 that referenced this issue Jan 26, 2014
@GSI
Copy link

GSI commented Jan 26, 2014

I published a Rails 4.0.2 project that reproduces the error:
https://github.com/GSI/rails-translate-routes_reproduce_issue-42

When you check it out and run "rake test", you should see the same error as shown in the README.

When removing the line starting with "ActionDispatch::Routing::Translator" from config/routes.rb, the "rake test" command succeeds.

@theo-bittencourt
Copy link

+1

@hugopeixoto
Copy link

I attempted to solve the problem.
The helpers are still not accessible from the tests, but they should be accessible from controllers and views. Hopefully this is enough.

Can someone check if it works, of if I broke something else?
https://github.com/hugopeixoto/rails-translate-routes/tree/issue-42

EDIT:
By the way, using my patch, I can successfully use the helpers in tests using:
Rails.application.routes.url_helpers.new_user_path
I will try to see if it is easy to fix that too.

@GSI
Copy link

GSI commented Feb 24, 2014

Note that @pebiantara (https://github.com/pebiantara/rails-translate-routes) solved the problem, but Rails 3 compatibility was lost in the process.

Sorry for being late providing that info.

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

No branches or pull requests

8 participants