diff --git a/app/controllers/admin/api_users_controller.rb b/app/controllers/admin/api_users_controller.rb index ccdd1c526..3ca70d543 100644 --- a/app/controllers/admin/api_users_controller.rb +++ b/app/controllers/admin/api_users_controller.rb @@ -5,8 +5,7 @@ module Admin def index @q = ApiUser.includes(:registrar).search(params[:q]) @api_users = @q.result.page(params[:page]) - @count = @q.result.count - @api_users = @api_users.per(params[:results_per_page]) if params[:results_per_page].to_i.positive? + api_users_paginate if params[:results_per_page].to_i.positive? end def new @@ -58,5 +57,9 @@ module Admin def registrar Registrar.find(params[:registrar_id]) end + + def api_users_paginate + @api_users = @api_users.per(params[:results_per_page]) + end end end diff --git a/app/views/admin/api_users/index.html.erb b/app/views/admin/api_users/index.html.erb index a622a06a2..b34b00a66 100644 --- a/app/views/admin/api_users/index.html.erb +++ b/app/views/admin/api_users/index.html.erb @@ -36,7 +36,7 @@