1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Revert "Don't symbolize tainted data." [ci skip]

Reason: i18n whitelists now locales without passing through symbols,
see https://github.com/svenfuchs/i18n/blob/master/lib/i18n.rb#L278.
Therefore, this snippet is no longer a good practice.

This reverts commit ec0664a6eb.
This commit is contained in:
Xavier Noria 2014-02-11 17:16:31 +01:00
parent 4359bc6a7a
commit e00ab2dab9

View file

@ -145,11 +145,7 @@ The _setting part_ is easy. You can set the locale in a `before_action` in the `
before_action :set_locale
def set_locale
if %w[en fr].include?(params[:locale])
I18n.locale = params[:locale]
else
I18n.locale = I18n.default_locale
end
I18n.locale = params[:locale] || I18n.default_locale
end
```