total_pages return in pagination with rails and kaminari

后端 未结 3 1645
礼貌的吻别
礼貌的吻别 2021-01-23 15:09

i want a pagination in my page, im using ruby and kaminari to this.



        
3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-23 15:39

    Try changing your controller code like the following:

    class ServicesController < ApplicationController
        def index
          @organs = Admin::Organ.all
          @services = Service.order(created_at: :desc).page(params[:page]).per(3)
        end
    end
    

提交回复
热议问题