Skip to content

Commit

Permalink
Use kaminari method total_count instead of size
Browse files Browse the repository at this point in the history
and use correct variable for profiles count.
  • Loading branch information
zaziemo committed Oct 28, 2023
1 parent 30f244f commit 47f42ea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/profiles_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def index
search_without_params
end
@paginated_profiles = @profiles.page(params[:page]).per(24)
@profiles_count = @profiles.size
@profiles_count = @paginated_profiles.total_count
end

def show
Expand Down
2 changes: 1 addition & 1 deletion app/views/shared/_search_filter.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<% if profiles_count > 0 %>
<% if @profiles_count > 0 %>
<div class="row row-cols-4">
<div class="col-12 col-sm-6 col-md-3">
<ul id="facet_languages" class="search-aggregation list-unstyled">
Expand Down

0 comments on commit 47f42ea

Please sign in to comment.