Added pagination to topic#show
This commit is contained in:
@@ -5,6 +5,9 @@ class TopicsController < ApplicationController
|
||||
def show
|
||||
@topic.hit! if @topic
|
||||
|
||||
@posts = @topic.posts.page(params[:page]).per(10)
|
||||
#Kaminari.paginate_array(@topic).page(params[:page]).per(10)
|
||||
|
||||
@my_blockquote = {
|
||||
'Quote' => [
|
||||
/\[quote(:.*)?=(.*?)\](.*?)\[\/quote\1?\]/mi,
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
</div>
|
||||
<div>
|
||||
<table>
|
||||
<% @topic.posts.each do |post| %>
|
||||
<% @posts.each do |post| %>
|
||||
<% if !post.user.blank? %>
|
||||
<tr>
|
||||
<td class="post_author" rowspan="2">
|
||||
@@ -41,6 +41,9 @@
|
||||
<%end%>
|
||||
<% end %>
|
||||
</table>
|
||||
<div style="text-align: center">
|
||||
<%= paginate(@posts)%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="right controls"><p><%= link_to "Back to Forum", forum_path(@topic.forum) %></p></div>
|
||||
|
||||
Reference in New Issue
Block a user