老师编辑作业、学生编辑作品时删除附件界面没刷新

This commit is contained in:
sw 2015-06-05 13:56:13 +08:00
parent f466084a17
commit 427553d4e5
2 changed files with 4 additions and 5 deletions

View File

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

View File

@ -220,7 +220,6 @@
<% end %> <% end %>
<% if @user.user_extensions && @user.user_extensions.location && !@user.user_extensions.location.empty?%> <% if @user.user_extensions && @user.user_extensions.location && !@user.user_extensions.location.empty?%>
<tr> <tr>
<td style=" float: right" width="70px"> <td style=" float: right" width="70px">
<span style="float: right"> <%= l(:label_location) %></span> <span style="float: right"> <%= l(:label_location) %></span>
</td> </td>