total_pages return in pagination with rails and kaminari

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

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



        
3条回答
  •  借酒劲吻你
    2021-01-23 15:21

    try this

    Old code

    @services = @services.order(created_at: :desc).paginate(page:params[:page], per_page: 3 )
    

    New code

    @services = Service.order(created_at: :desc).paginate(page:params[:page], per_page: 3 )
    

提交回复
热议问题