博客删除报错的问题

This commit is contained in:
lizanle 2015-10-26 17:20:15 +08:00
parent ca0b7e77ba
commit 6c5c7988dc
1 changed files with 1 additions and 1 deletions

View File

@ -56,7 +56,7 @@ class BlogCommentsController < ApplicationController
end
def destroy
@article = BlogComment.find(params[:id])
unless @article.children.empty? #如果是文章被删,那么跳转到用户博客界面
if @article.parent_id.nil? #如果是文章被删,那么跳转到用户博客界面
@article.children.delete
@article.delete
redirect_to user_blogs_path(:user_id=>User.current)