paginate threads

This commit is contained in:
jomo
2014-09-22 06:16:54 +02:00
parent ae81a2f76d
commit c0507bdfdf
2 changed files with 2 additions and 0 deletions

View File

@@ -12,6 +12,7 @@ class ForumsController < ApplicationController
# 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]
end
@threads = Kaminari.paginate_array(@threads).page(params[:page])
end
def edit