Add spanish locales and gravatar options
This commit is contained in:
@@ -13,7 +13,20 @@ class ApplicationController < ActionController::Base
|
||||
|
||||
rescue_from SimplyStored::RecordNotFound, with: :show_404
|
||||
|
||||
private
|
||||
# protected
|
||||
#
|
||||
# def after_sign_in_path_for(resource)
|
||||
# case resource
|
||||
# when 'user' then Mozo.user_url
|
||||
# else
|
||||
# main_app.root_path
|
||||
# end
|
||||
# # Customize the redirect path here
|
||||
# # For example, redirect to a dashboard page
|
||||
# dashboard_path || root_path
|
||||
# end
|
||||
#
|
||||
private
|
||||
|
||||
def authenticate_employee!
|
||||
if auth_token = params[:auth_token].presence || request.headers['HTTP_AUTH_TOKEN'].presence
|
||||
@@ -67,8 +80,9 @@ private
|
||||
end
|
||||
|
||||
def set_locale
|
||||
#session[:locale] = (params[:locale].presence || session[:locale] || Rails.configuration.i18n.default_locale).to_sym
|
||||
I18n.locale = params[:locale].presence.try(:to_sym) || Rails.configuration.i18n.default_locale
|
||||
session[:locale] = (params[:locale].presence || session[:locale] || Rails.configuration.i18n.default_locale).to_sym
|
||||
I18n.locale = session[:locale]
|
||||
# I18n.locale = params[:locale].presence.try(:to_sym) || Rails.configuration.i18n.default_locale
|
||||
end
|
||||
|
||||
def _render_with_renderer_json(resource, options)
|
||||
@@ -98,9 +112,10 @@ private
|
||||
|
||||
def after_sign_in_path_for(resource)
|
||||
case resource
|
||||
when Employee then supplier_root_path
|
||||
when Administrator then cmtool.root_path
|
||||
else root_path
|
||||
when User then Mozo.user_url
|
||||
when Employee then Mozo.supplier_url
|
||||
when Administrator then cmtool.root_path
|
||||
else root_path
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user