From f4132e6ee0e9b11fff23f03e13c857493e1de960 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 9 Jul 2015 11:35:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=85=B1=E5=90=8C=E8=B4=B4?= =?UTF-8?q?=E5=90=A7=EF=BC=8C=E5=B8=96=E5=AD=90=E6=8E=92=E5=BA=8F=E6=B7=B7?= =?UTF-8?q?=E4=B9=B1=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/forums_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/forums_controller.rb b/app/controllers/forums_controller.rb index 253e1d28d..2b44d51de 100644 --- a/app/controllers/forums_controller.rb +++ b/app/controllers/forums_controller.rb @@ -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