【发布时间】:2018-12-12 04:06:44
【问题描述】:
我目前正在使用 will_paginate 对表格进行分页,使用 jquery 也可以进行排序。问题是分页只会传递表格,因为当前可查看的对象表格说 100 个表格项目中的 25 个。所以排序只发生在 25 的一页上。有没有办法对所有 100 项进行排序,然后分页?
@people = @results.records.where(active: true).order('signup_at DESC NULLS LAST').paginate(page: params[:page], per_page: 25)
- if @people.any?
%table.ui.sortable.striped.table
%thead
%tr
%th Name
%th Email
%th Phone
%th Submissions
%th Signed up
%th Signup form
%th Most recent note
%tbody
= render @people
= 为@people 分页
【问题讨论】:
标签: jquery ruby-on-rails haml will-paginate