aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2014-02-11 17:16:31 +0100
committerXavier Noria <fxn@hashref.com>2014-02-11 17:18:19 +0100
commite00ab2dab9671603dcc8ab571baf1b1df100f99b (patch)
treebe5676dfa6ea650f232833c638f4d970c0d7b9b2
parent4359bc6a7a6437899cca4ff7f719be8b29f0b6b3 (diff)
downloadrails-e00ab2dab9671603dcc8ab571baf1b1df100f99b.tar.gz
rails-e00ab2dab9671603dcc8ab571baf1b1df100f99b.tar.bz2
rails-e00ab2dab9671603dcc8ab571baf1b1df100f99b.zip
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 ec0664a6eb8906fcd31a53a1efad69bdc7fe6f5b.
-rw-r--r--guides/source/i18n.md6
1 files changed, 1 insertions, 5 deletions
diff --git a/guides/source/i18n.md b/guides/source/i18n.md
index 088080721e..d72717fa3b 100644
--- a/guides/source/i18n.md
+++ b/guides/source/i18n.md
@@ -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
```