Humanize in accented characters

Asked

Viewed 401 times

1

I have the following problem, I have some error messages in my system, but when there are accents in the messages, humanize does not apply to these characters, I tried to use the gem 'brazilian-rails', however as it is discontinued, eventually some bugs happened in my system.

Example of my mistake:

"Número É muito longo (máximo: 9 caracteres)"

Even with humanize, the is continues in capital letters.

I use Rails 3.2.15

1 answer

3


You can give an example of how you are using humanize?

In any case, it is a problem with the UTF-8.

Test on the console

"É".downcase

It doesn’t work while

"É".mb_chars.downcase

yes.

Then an exit would be to use:

"Número É muito longo (máximo: 9 caracteres)".mb_chars.downcase.humanize
  • Really worked, thank you very much!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.