修改共同贴吧,帖子排序混乱的问题
This commit is contained in:
parent
06c2718b54
commit
f4132e6ee0
|
@ -86,7 +86,7 @@ class ForumsController < ApplicationController
|
|||
order(sort_clause).
|
||||
preload(:author, {:last_reply => :author}).
|
||||
all
|
||||
|
||||
@memos
|
||||
flash.now[:error] = "#{l :label_memo_create_fail}: #{@memo.errors.full_messages[0]}"
|
||||
# back_error_page = @memo.parent_id.nil? ? forum_path(@forum) : forum_memo_path(@forum, @memo.parent_id)
|
||||
format.html { render action: :show, layout: 'base_forums' }#, error: "#{l :label_memo_create_fail}: #{@memo.errors.full_messages[0]}" }
|
||||
|
@ -122,14 +122,14 @@ class ForumsController < ApplicationController
|
|||
@topic_count = @forum.topics.count
|
||||
@topic_pages = Paginator.new @topic_count, per_page_option, params['page']
|
||||
@memos = @forum.topics.
|
||||
reorder("#{Memo.table_name}.sticky DESC").
|
||||
# reorder("#{Memo.table_name}.sticky DESC").
|
||||
includes(:last_reply).
|
||||
limit(@topic_pages.per_page).
|
||||
offset(@topic_pages.offset).
|
||||
order(sort_clause).
|
||||
preload(:author, {:last_reply => :author}).
|
||||
all
|
||||
|
||||
@memos
|
||||
# @offset, @limit = api_offset_and_limit({:limit => 10})
|
||||
# @forum = Forum.find(params[:id])
|
||||
# @memos_all = @forum.topics
|
||||
|
|
Loading…
Reference in New Issue