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