Answer the question
In order to leave comments, you need to log in
How to prevent rails from mangling unicode links?
routes.rb :
get '/адрес/на/русском', :to => 'controller#action, :as => :russian
= link_to 'моя ссылка на русский урл', russian_path
<a href="%2F%D0%B0%D0%B4%D1%80%D0%B5%D1%81%2F%D0%BD%D0%B0%2F%D1%80%D1%83%D1%81%D1%81%D0%BA%D0%BE%D0%BC">моя ссылка на русский урл</a>
<a href="/адрес/на/русском">моя ссылка на русский урл</a>
Answer the question
In order to leave comments, you need to log in
There is a better solution: gem https://github.com/romiras/rails-translate-routes
Gemfile:
allows you to store localized paths in the config/locales/routes.yml file
en: routes: # you can leave empty locales, for example the default one es: routes: products: productos contact: contacto new: crear
and the paths themselves in the code remain clear
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question