Skip to content

Commit

Permalink
Paginate all the things
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtOfCode- committed Sep 4, 2017
1 parent 625cc85 commit 7a857f7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/domain_tags_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def remove
end

def show
@domains = @tag.spam_domains
@domains = @tag.spam_domains.paginate(page: params[:page], per_page: 100)
@counts = SpamDomain.where(id: @domains.map(&:id)).joins(:posts).group('spam_domains.id').count
end

Expand Down
2 changes: 2 additions & 0 deletions app/views/domain_tags/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@
<% end %>
</tbody>
</table>

<%= will_paginate @domains, renderer: BootstrapPagination::Rails %>
4 changes: 3 additions & 1 deletion app/views/spam_domains/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,6 @@
<%= render 'posts/post', :post => post %>
<% end %>
</tbody>
</table>
</table>

<%= will_paginate @posts, renderer: BootstrapPagination::Rails %>

0 comments on commit 7a857f7

Please sign in to comment.