|
|
|
@ -216,13 +216,13 @@ class AttachmentsController < ApplicationController
|
|
|
|
|
if @attachment.container.is_a?(News)
|
|
|
|
|
format.html { redirect_to_referer_or news_path(@attachment.container) }
|
|
|
|
|
elsif @attachment.container.is_a?(StudentWorksScore)
|
|
|
|
|
@is_destroy = true #根据ID删除页面对应的数据,js刷新页面
|
|
|
|
|
@is_destroy = true unless params[:attachment_id] #根据ID删除页面对应的数据,js刷新页面
|
|
|
|
|
format.js
|
|
|
|
|
elsif @attachment.container.is_a?(HomeworkCommon)
|
|
|
|
|
@is_destroy = true #根据ID删除页面对应的数据,js刷新页面
|
|
|
|
|
@is_destroy = true unless params[:attachment_id] #根据ID删除页面对应的数据,js刷新页面
|
|
|
|
|
format.js
|
|
|
|
|
elsif @attachment.container.is_a?(StudentWork)
|
|
|
|
|
@is_destroy = true #根据ID删除页面对应的数据,js刷新页面
|
|
|
|
|
@is_destroy = true unless params[:attachment_id] #根据ID删除页面对应的数据,js刷新页面
|
|
|
|
|
format.js
|
|
|
|
|
elsif @attachment.container.is_a?(Message)
|
|
|
|
|
format.html { redirect_to_referer_or new_board_message_path(@attachment.container) }
|
|
|
|
@ -246,7 +246,7 @@ class AttachmentsController < ApplicationController
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
format.js
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def delete_homework
|
|
|
|
|