diff --git a/app/controllers/forumthreads_controller.rb b/app/controllers/forumthreads_controller.rb index 3f18ffa..7b83104 100644 --- a/app/controllers/forumthreads_controller.rb +++ b/app/controllers/forumthreads_controller.rb @@ -7,6 +7,7 @@ class ForumthreadsController < ApplicationController end def show + @replies = @thread.replies.page(params[:page]) end def edit diff --git a/app/views/forumthreads/show.html.erb b/app/views/forumthreads/show.html.erb index 3473693..a3624c8 100644 --- a/app/views/forumthreads/show.html.erb +++ b/app/views/forumthreads/show.html.erb @@ -21,9 +21,10 @@

<%= "#{pluralize(@thread.replies.length, 'reply')}." %>

- <% @thread.replies.each do |reply| %> + <% @replies.each do |reply| %> <%= render partial: "threadreplies/reply", locals: {reply: reply} %> <% end %> + <%= paginate @replies %> <% if @thread.can_write?(current_user) %> <%= render partial: "threadreplies/new", locals: {reply: Threadreply.new(forumthread: @thread)} %> <% else %>