合作者分页问题

dev_forum
daiao 5 years ago
parent ce07bf7e34
commit c211548a13

@ -635,7 +635,7 @@ class ShixunsController < ApplicationController
end end
page = params[:page] || 1 page = params[:page] || 1
limit = params[:limit] || 20 limit = params[:limit] || 20
@total_count = @users.count @user_count = @users.count
@users = @users.page(page).per(limit) @users = @users.page(page).per(limit)
end end

@ -1,5 +1,5 @@
#json.partial! "users/users_list", users: @users #json.partial! "users/users_list", users: @users
json.total_count @total_count json.user_count @user_count
json.users do json.users do
json.array! @users do |user| json.array! @users do |user|
json.user_id user.id json.user_id user.id

Loading…
Cancel
Save