paginate threads
This commit is contained in:
@@ -12,6 +12,7 @@ class ForumsController < ApplicationController
|
|||||||
# sticky goes first, then sort by last activity (new replies)
|
# sticky goes first, then sort by last activity (new replies)
|
||||||
[t.sticky ? 0 : 1, -(t.replies.last.try(:created_at) || t.created_at).to_i]
|
[t.sticky ? 0 : 1, -(t.replies.last.try(:created_at) || t.created_at).to_i]
|
||||||
end
|
end
|
||||||
|
@threads = Kaminari.paginate_array(@threads).page(params[:page])
|
||||||
end
|
end
|
||||||
|
|
||||||
def edit
|
def edit
|
||||||
|
|||||||
@@ -32,4 +32,5 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<%= paginate @threads %>
|
||||||
</div>
|
</div>
|
||||||
Reference in New Issue
Block a user