1

Rails 4.2.9

I have a number of properties that store multibyte characters strings. I can use mb_chars to safely modify a string:

'a string'.mb_chars.upcase

but I want to avoid changing every occurrence of .upcase in my views to .mb_chars.upcase

Is it possible to configure Rails to use mb_chars by default, or is it safe to modify a String method like upcase to use mb_chars (if so, what is the best way of doing this)?

d_a_n
  • 317
  • 7
  • 16
  • 1
    This can help you: https://stackoverflow.com/questions/5654517/in-ruby-on-rails-to-extend-the-string-class-where-should-the-code-be-put-in – Ronan Louarn Sep 16 '17 at 15:39

0 Answers0