Skip to content

Commit

Permalink
Merge pull request #14016 from devlinzed/i18n_doc_fix
Browse files Browse the repository at this point in the history
Documentation: Don't symbolize tainted data. [ci skip]
  • Loading branch information
fxn committed Feb 11, 2014
2 parents b12c1b8 + ec0664a commit 4359bc6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion guides/source/i18n.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down

0 comments on commit 4359bc6

Please sign in to comment.