分页报500

dev_forum
daiao 5 years ago
parent fbaad5dd6c
commit 9bc8453ba3

@ -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
@users_count = @users.count @total_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.users_count @users_count json.total_count @total_count
json.array! @users do |user| json.array! @users do |user|
json.user_id user.id json.user_id user.id
json.identify user.identity json.identify user.identity

Loading…
Cancel
Save