Desktop notifications
This commit is contained in:
parent
e616ffc5d6
commit
fb48cc3b74
3 changed files with 15 additions and 6 deletions
|
@ -13,7 +13,7 @@ class ApplicationController < ActionController::Base
|
|||
rescue_from ActiveRecord::RecordNotFound, with: :not_found
|
||||
|
||||
before_action :store_current_location, except: :raise_not_found, unless: :devise_controller?
|
||||
before_action :set_locale, if: 'user_signed_in?'
|
||||
before_action :set_locale
|
||||
|
||||
def raise_not_found
|
||||
raise ActionController::RoutingError, "No route matches #{params[:unmatched_route]}"
|
||||
|
@ -26,7 +26,7 @@ class ApplicationController < ActionController::Base
|
|||
end
|
||||
|
||||
def set_locale
|
||||
I18n.locale = current_user.locale || I18n.default_locale
|
||||
I18n.locale = current_user.try(:locale) || I18n.default_locale
|
||||
rescue I18n::InvalidLocale
|
||||
I18n.locale = I18n.default_locale
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue