update admin bsb crm layou

This commit is contained in:
Aung Myo
2017-10-20 18:50:30 +06:30
parent 66df689f4e
commit 80f1170d8a
15 changed files with 379 additions and 197 deletions

View File

@@ -12,6 +12,7 @@ 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

View File

@@ -10,6 +10,16 @@ class BaseCrmController < ActionController::Base
redirect_to root_path
end
#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
def current_user
@current_user ||= Employee.find_by_token_session(session[:session_token]) if session[:session_token]
end

View File

@@ -1,4 +1,4 @@
class Crm::BookingsController < ApplicationController
class Crm::BookingsController < BaseCrmController
load_and_authorize_resource
def update_booking
booking = Booking.find(params[:booking_id])

View File

@@ -1,4 +1,4 @@
class Crm::CustomersController < ApplicationController #BaseCrmController
class Crm::CustomersController < BaseCrmController
load_and_authorize_resource except: [:create]
before_action :set_crm_customer, only: [:show, :edit, :update, :destroy]

View File

@@ -1,4 +1,4 @@
class Crm::DiningQueuesController < ApplicationController #BaseCrmController
class Crm::DiningQueuesController < BaseCrmController
load_and_authorize_resource
before_action :set_dining_queue, only: [:show, :edit, :update, :destroy]

View File

@@ -1,4 +1,4 @@
class Crm::HomeController < ApplicationController
class Crm::HomeController < BaseCrmController
def index
@booking = Booking.all