diff options
author | Xavier Noria <fxn@hashref.com> | 2014-02-11 17:07:17 +0100 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2014-02-11 17:07:17 +0100 |
commit | 4359bc6a7a6437899cca4ff7f719be8b29f0b6b3 (patch) | |
tree | 4af90f2225e06ee6269bc3ed894eebcf08992b6b /guides | |
parent | b12c1b858ea8a781d221e94e2fc22bf729fe2086 (diff) | |
parent | ec0664a6eb8906fcd31a53a1efad69bdc7fe6f5b (diff) | |
download | rails-4359bc6a7a6437899cca4ff7f719be8b29f0b6b3.tar.gz rails-4359bc6a7a6437899cca4ff7f719be8b29f0b6b3.tar.bz2 rails-4359bc6a7a6437899cca4ff7f719be8b29f0b6b3.zip |
Merge pull request #14016 from devlinzed/i18n_doc_fix
Documentation: Don't symbolize tainted data. [ci skip]
Diffstat (limited to 'guides')
-rw-r--r-- | guides/source/i18n.md | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/guides/source/i18n.md b/guides/source/i18n.md index d72717fa3b..088080721e 100644 --- a/guides/source/i18n.md +++ b/guides/source/i18n.md @@ -145,7 +145,11 @@ The _setting part_ is easy. You can set the locale in a `before_action` in the ` before_action :set_locale def set_locale - I18n.locale = params[:locale] || I18n.default_locale + if %w[en fr].include?(params[:locale]) + I18n.locale = params[:locale] + else + I18n.locale = I18n.default_locale + end end ``` |