Add paginate to topics

This commit is contained in:
taitus
2017-08-07 18:20:57 +02:00
parent b4cdca215d
commit 1dc3cd4bb3
2 changed files with 3 additions and 2 deletions

View File

@@ -14,6 +14,6 @@ class CommunitiesController < ApplicationController
end
def load_topics
@topics = @community.topics
@topics = @community.topics.page(params[:page])
end
end

View File

@@ -11,8 +11,9 @@
<div class="row">
<div class="small-12 medium-9 column">
<div id="topics">
<%= render "topics/topics", topics: @community.topics %>
<%= render "topics/topics", topics: @topics %>
</div>
<%= paginate @topics %>
</div>
<div class="small-12 medium-3 column">