取消大纲不删除博客

This commit is contained in:
lizanle 2015-10-30 14:22:11 +08:00
parent b97ad10cc9
commit 8531ab51ab
1 changed files with 1 additions and 3 deletions

View File

@ -57,9 +57,7 @@ class BlogCommentsController < ApplicationController
def destroy
@article = BlogComment.find(params[:id])
if @article.parent_id.nil? #如果是文章被删那么跳转到用户博客界面如果带了course_id过来那么就要跳转到课程首页
if params[:course_id]
@article.children.delete
@article.delete
if params[:course_id] #如果带了课程id过来说明这是课程大纲不要删除只需取消课程大纲就ok了
@course = Course.find(params[:course_id])
@course.outline = 0
@course.save