Reputation: 9952
now i'm using # encoding: utf-8
in every controller, where :notice message is not in latin
i've tried to put it in ApplicationController, tried to add <meta charset="utf-8">
at the top of application.html.erb, none worked, any help ?
EDIT: config.encoding = "utf-8" also set in application.rb
EDIT:
error appears with this code:
redirect_to root_url, :notice => "Вышли успешно"
and here's an error
:syntax error, unexpected $end, expecting '}' ..._or_to root_url, :notice => 'Вышли успешно.' }
Upvotes: 0
Views: 2853
Reputation: 2380
This is a duplicate of Set global default encoding for ruby 1.9, but in your case I suggest using the I18n
:
redirect_to root_url, :notice => I18n.t 'sessions.destroy.success'
# config/locales/ru.yml
ru:
sessions:
destroy:
success: Вышли успешно
As for locales key naming, AFAIK there's no convention, here I use "controller_name.action_name.result" scheme.
Upvotes: 2