Skip to content
Browse files

Redirect on locale error

  • Loading branch information...
1 parent 83dc480 commit dc5bf6ee45ed91c80eb804fd38edec7e12730e27 @robotmay committed
Showing with 2 additions and 0 deletions.
  1. +2 −0 app/controllers/application_controller.rb
View
2 app/controllers/application_controller.rb
@@ -62,6 +62,8 @@ def enable_sharing_mode
def set_locale
I18n.locale = params[:locale] || (user_signed_in? ? current_user.locale : I18n.default_locale)
+ rescue I18n::InvalidLocale => ex
+ redirect_to url_for(locale: I18n.default_locale), alert: ex.message
end
def fetch_categories

0 comments on commit dc5bf6e

Please sign in to comment.
Something went wrong with that request. Please try again.