francesc / rails-translate-routes

MIT License
147 stars 50 forks source link

When translations are enabled url_for generates different URLs #20

Closed szimek closed 12 years ago

szimek commented 12 years ago

I'm using high_voltage gem that provides the following route:

match "/pages/:id", to: "high_voltage#show", as: "pages"

I also have my own routes to make some URLs prettier:

get "/faq", to: "high_voltage#show", id: "faq"

Without route translations, when I'm on page /faq, url_for(locale: :de) generates /faq?locale=de. When I enable route translations it generates /pages/faq?locale=de instead.

Any idea why translating routes changes result of url_for?

francesc commented 12 years ago

I use a different approach for static pages in combination with translated routes, let me know if your interested on it.