From 41f302c467fcb0343a3b128bae611f3fcd84671e Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 18 Mar 2015 08:53:36 +0800 Subject: [PATCH] =?UTF-8?q?cotroller=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/discuss_demos_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/discuss_demos_controller.rb b/app/controllers/discuss_demos_controller.rb index 31b0f1dcc..1b140714f 100644 --- a/app/controllers/discuss_demos_controller.rb +++ b/app/controllers/discuss_demos_controller.rb @@ -1,5 +1,6 @@ class DiscussDemosController < ApplicationController def index + @discuss_demo_list = DiscussDemo.where("body is not null").order("created_at desc").page(params[:page] || 1).per(10) end @@ -24,7 +25,7 @@ class DiscussDemosController < ApplicationController end def destroy - DiscussDemo.delete_all(["id = ?",params[:id]]) + DiscussDemo.destroy(params[:id]) redirect_to :controller=> 'discuss_demos',:action => 'index' end