博客删除报错的问题
This commit is contained in:
parent
ca0b7e77ba
commit
6c5c7988dc
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue