删除历史资源后再删除所有资源不翻页

This commit is contained in:
cxt 2017-04-14 19:15:25 +08:00
parent e20b3f84f6
commit 80a53d8120
2 changed files with 2 additions and 1 deletions

View File

@ -339,6 +339,7 @@ class AttachmentsController < ApplicationController
# prams[:type] => history 历史版本
def destroy
page = params[:page] ? params[:page].to_i : 1
@curr_page = page
if params[:type] == "history"
begin
AttachmentHistory.find(params[:history_id]).destroy

View File

@ -26,7 +26,7 @@
<td class="text_c"><%= history.try(:quotes).to_i %></td>
<td class="text_c"><%= format_time(history.created_on) %></td>
<td class="text_c">
<%= link_to( '删除资源', attachment_path(history.attachment, :history_id => history, :type => "history_delete"),
<%= link_to( '删除资源', attachment_path(history.attachment, :page => @curr_page, :history_id => history, :type => "history_delete"),
:remote => true,
:data => {:confirm => l(:text_are_you_sure)},
:method => :delete,