more fixes for order of threadreplies

This commit is contained in:
jomo
2017-07-07 02:05:04 +02:00
parent 72a6dcc54a
commit 8c6eb8ac17
5 changed files with 5 additions and 5 deletions

View File

@@ -37,7 +37,7 @@ class ThreadrepliesController < ApplicationController
if @reply.update_attributes(reply_params)
@reply.send_new_reply_mail(old_content)
flash[:notice] = "Reply updated!"
position = @reply.thread.replies.index(@reply)
position = @reply.thread.replies.order(:id).index(@reply)
page = position / Kaminari.config.default_per_page + 1
redirect_to forumthread_path(@reply.thread, page: page) + "#reply-#{@reply.id}"
else