From 1dc3cd4bb386e03a7f0c1441f9d202508ee0ee6e Mon Sep 17 00:00:00 2001 From: taitus Date: Mon, 7 Aug 2017 18:20:57 +0200 Subject: [PATCH] Add paginate to topics --- app/controllers/communities_controller.rb | 2 +- app/views/communities/show.html.erb | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/communities_controller.rb b/app/controllers/communities_controller.rb index e4421281f..b8d691aa7 100644 --- a/app/controllers/communities_controller.rb +++ b/app/controllers/communities_controller.rb @@ -14,6 +14,6 @@ class CommunitiesController < ApplicationController end def load_topics - @topics = @community.topics + @topics = @community.topics.page(params[:page]) end end diff --git a/app/views/communities/show.html.erb b/app/views/communities/show.html.erb index 33eaf47d4..ab7692f3b 100644 --- a/app/views/communities/show.html.erb +++ b/app/views/communities/show.html.erb @@ -11,8 +11,9 @@
- <%= render "topics/topics", topics: @community.topics %> + <%= render "topics/topics", topics: @topics %>
+ <%= paginate @topics %>