Skip to content

Commit 9d96c89

Browse files
authored
Merge pull request #1915 from codidact/cellio/1914-tag-count
fix incorrect count on tags page
2 parents 28d2763 + d373009 commit 9d96c89

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

app/controllers/tags_controller.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ def category
4747
@tag_set.tags
4848
end.list_includes
4949

50+
@count_all = @tags.length || 0
51+
5052
table = params[:hierarchical].present? ? 'tags_paths' : 'tags'
5153

5254
@tags = @tags.left_joins(:posts)

app/views/tags/category.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
<% unless params[:q].present? %>
3030
<div class="category-meta">
31-
<h3><%= pluralize(@count, 'tag') %></h3>
31+
<h3><%= pluralize(@count_all, 'tag') %></h3>
3232
<div class="button-list is-gutterless has-margin-2">
3333
<%= link_to 'Usage', category_tags_path(@category),
3434
class: "button is-muted is-outlined #{request.query_parameters.size == 0 ? 'is-active' : ''}",

0 commit comments

Comments
 (0)