francesc / rails-translate-routes

MIT License
147 stars 50 forks source link

url_for() acts as crazy when doing a "redirect" conditions in Routes #40

Open gmontard opened 11 years ago

gmontard commented 11 years ago

Hello,

I've been using translate_routes gem on Rails 2 without any problems and since we are migrating to Rails 3 i decided to use yours, thanks for making it !

In Rails 3 it's now possible to add redirect() routes, like this : match "/home" => redirect("/totot")

My problem is that if i do that and use your plugin, the "url_for" method act as crazy, every url created then display a link to that redirect with the correct action and controller as parameters,

for example : url_for(:controller=>"user", :action=>"create") then display : "/toto?controller=user&action=create

Are you aware of that ?

Thanks a lot.

Fire-Dragon-DoL commented 11 years ago

I have the same problem, trying to redirect from the current page to current page with a different locale, so I were using url_for(locale: :other_locale) and it results in action?locale=other_locale