diff --git a/app/controllers/forums_controller.rb b/app/controllers/forums_controller.rb index 61cd0d9..21321fb 100644 --- a/app/controllers/forums_controller.rb +++ b/app/controllers/forums_controller.rb @@ -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 diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erb index 0b3a958..bd985cd 100644 --- a/app/views/forums/show.html.erb +++ b/app/views/forums/show.html.erb @@ -32,4 +32,5 @@ <% end %> + <%= paginate @threads %> \ No newline at end of file