Edit pagination

This commit is contained in:
San Wai Lwin
2018-06-12 17:11:43 +06:30
parent 90cdc04300
commit c037c85055
3 changed files with 36 additions and 5 deletions

View File

@@ -53,7 +53,7 @@ class Origami::CustomersController < BaseOrigamiController
@sale_id = params[:sale_id]
@cashier_type = params[:type]
@page = params[:page]
@page = params[:dir_page]
if(@sale_id[0,3] == "SAL")
@booking = Booking.find_by_sale_id(@sale_id)
@@ -74,15 +74,17 @@ class Origami::CustomersController < BaseOrigamiController
end
filter = params[:filter]
puts "filter"
puts filter
if filter.nil?
@crm_customers = Customer.order("customer_id").page(params[:page])
puts params[:page]
@crm_customers = Customer.order("customer_id") #.page(params[:page])
#@products = Product.order("name").page(params[:page]).per(5)
else
@crm_customers = Customer.search(filter)
end
#@crm_customers = Customer.all
@crm_customers = Kaminari.paginate_array(@crm_customers).page(params[:page]).per(50)
@crm_customers = Kaminari.paginate_array(@crm_customers).page(params[:page]).per(20)
@crm_customer = Customer.new
@count_customer = Customer.count_customer