add action base and update base ctrls

This commit is contained in:
Yan
2018-02-26 17:42:54 +06:30
parent 07e208a457
commit 13b7b1f800
9 changed files with 100 additions and 23 deletions

View File

@@ -1,11 +1,11 @@
class ApplicationController < ActionController::Base
include LicenseVerification
include LoginVerification
#before_action :check_installation
protect_from_forgery with: :exception
# lookup domain for db from provision
before_action :set_locale
# before_action :set_locale
helper_method :current_company,:current_login_employee,:current_user
# alias_method :current_user, :current_login_employee,:current_user
@@ -13,16 +13,6 @@ class ApplicationController < ActionController::Base
#all token authentication must be done here
#response format must be set to JSON
#change locallization
def set_locale
I18n.locale = params[:locale] || I18n.default_locale
end
# RESTful url for localize
def default_url_options
{ locale: I18n.locale }
end
rescue_from CanCan::AccessDenied do |exception|
flash[:warning] = exception.message
redirect_to root_path