Question

I have words like the following: "torbjörn".

I want to replace special characters like the 6th letter "ö" with the latin equivalant, i.e. "o".

I assume the module SanitizeHelper will do this for me, but I don't understand how and where to include it.

I just need this for one view, so if it's favorable to not include it for the whole app, I would like to have that taken in mind as well.

Was it helpful?

Solution

You can use transliterate:

ActiveSupport::Inflector::transliterate "torbjörn" # => "torbjorn"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top