大纲设置的图标改动 ,添加删除动作
This commit is contained in:
parent
a27c359df4
commit
00157b4302
|
@ -56,12 +56,22 @@ class BlogCommentsController < ApplicationController
|
||||||
end
|
end
|
||||||
def destroy
|
def destroy
|
||||||
@article = BlogComment.find(params[:id])
|
@article = BlogComment.find(params[:id])
|
||||||
if @article.parent_id.nil? #如果是文章被删,那么跳转到用户博客界面
|
if @article.parent_id.nil? #如果是文章被删,那么跳转到用户博客界面,如果带了course_id过来,那么就要跳转到课程首页
|
||||||
@article.children.delete
|
if params[:course_id]
|
||||||
@article.delete
|
@article.children.delete
|
||||||
redirect_to user_blogs_path(:user_id=>User.current)
|
@article.delete
|
||||||
|
@course = Course.find(params[:course_id])
|
||||||
|
@course.outline = 0
|
||||||
|
@course.save
|
||||||
|
redirect_to course_path(:id=>params[:course_id])
|
||||||
|
else
|
||||||
|
@article.children.delete
|
||||||
|
@article.delete
|
||||||
|
redirect_to user_blogs_path(:user_id=>User.current)
|
||||||
|
end
|
||||||
|
|
||||||
else#如果是回复被删,
|
else#如果是回复被删,
|
||||||
if params[:course_id] #如果呆了course_id过来了,那么这是要跳到课程大纲去的
|
if params[:course_id] #如果带了course_id过来了,那么这是要跳到课程大纲去的
|
||||||
@article.delete
|
@article.delete
|
||||||
redirect_to show_course_outline_course_path(:id=>params[:course_id])
|
redirect_to show_course_outline_course_path(:id=>params[:course_id])
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue