cotroller修改

memcached_alan
lizanle 11 years ago
parent 112b7fb27f
commit 41f302c467

@ -1,5 +1,6 @@
class DiscussDemosController < ApplicationController class DiscussDemosController < ApplicationController
def index def index
@discuss_demo_list = DiscussDemo.where("body is not null").order("created_at desc").page(params[:page] || 1).per(10) @discuss_demo_list = DiscussDemo.where("body is not null").order("created_at desc").page(params[:page] || 1).per(10)
end end
@ -24,7 +25,7 @@ class DiscussDemosController < ApplicationController
end end
def destroy def destroy
DiscussDemo.delete_all(["id = ?",params[:id]]) DiscussDemo.destroy(params[:id])
redirect_to :controller=> 'discuss_demos',:action => 'index' redirect_to :controller=> 'discuss_demos',:action => 'index'
end end

Loading…
Cancel
Save