cotroller修改

This commit is contained in:
lizanle 2015-03-18 08:53:36 +08:00
parent 112b7fb27f
commit 41f302c467
1 changed files with 2 additions and 1 deletions

View File

@ -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