diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 6316fa0cf30..8e43c8250bb 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -249,12 +249,12 @@ def role end def pagination_options - { - '1' => 25, - '2' => 50, - '3' => 100, - '4' => User.count - } + [ + ['25', 25], + ['50', 50], + ['100', 100], + ['All', User.count] + ] end # For filtering the users list with proper search and pagination. @@ -270,8 +270,8 @@ def paginate_list @search_by = params[:search_by] # Sets the number of users to display per page based on the 'per_page' parameter from the request. - # If no 'per_page' parameter is provided, it defaults to '3', which corresponds to displaying all users on one page. - @per_page = params[:per_page] || '3' + # If no 'per_page' parameter is provided, it defaults to '2', which corresponds to displaying 50 users on one page. + @per_page = params[:per_page] || '2' # search for corresponding users # users = User.search_users(role, user_id, letter, @search_by) diff --git a/app/views/users/list.html.erb b/app/views/users/list.html.erb index b3675b523ed..4a91afbf0bc 100644 --- a/app/views/users/list.html.erb +++ b/app/views/users/list.html.erb @@ -13,7 +13,7 @@ <%= submit_tag("Search") %> <%= label_tag :per_page, 'Users per page: ' %> - <%= select_tag(:per_page, options_for_select(@pagination_options, selected: params[:per_page]), onchange: 'this.form.submit()') %> + <%= select_tag(:per_page, options_for_select(@pagination_options, selected: params[:per_page] || '25'), onchange: 'this.form.submit()') %> <% end %>