aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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
```