diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 46428d5e8..c310087f7 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -191,7 +191,8 @@ class AttachmentsController < ApplicationController if !@attachment.container.nil? && (@attachment.container.is_a?(Course) || ((@attachment.container.has_attribute?(:course) || @attachment.container.has_attribute?(:course_id) ) && @attachment.container.course ) || ((@attachment.container.has_attribute?(:board) || @attachment.container.has_attribute?(:board_id)) && - @attachment.container.board && @attachment.container.board.course ) || @attachment.container.is_a?(StudentWorksScore) || @attachment.container.is_a?(HomeworkCommon)) + @attachment.container.board && @attachment.container.board.course ) || @attachment.container.is_a?(StudentWorksScore) || @attachment.container.is_a?(HomeworkCommon) || + @attachment.container.is_a?(StudentWork)) if @attachment.container.is_a?(News) format.html { redirect_to_referer_or news_path(@attachment.container) } elsif @attachment.container.is_a?(StudentWorksScore) @@ -200,6 +201,9 @@ class AttachmentsController < ApplicationController elsif @attachment.container.is_a?(HomeworkCommon) @is_destroy = true #根据ID删除页面对应的数据,js刷新页面 format.js + elsif @attachment.container.is_a?(StudentWork) + @is_destroy = true #根据ID删除页面对应的数据,js刷新页面 + format.js elsif @attachment.container.is_a?(Message) format.html { redirect_to_referer_or new_board_message_path(@attachment.container) } elsif @course.nil? diff --git a/app/views/student_work/_show.html.erb b/app/views/student_work/_show.html.erb index 603875d5b..4e9f337c0 100644 --- a/app/views/student_work/_show.html.erb +++ b/app/views/student_work/_show.html.erb @@ -60,7 +60,7 @@ <% end%> -