Resourcified attachments.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7948 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang committed 2011-11-27 11:16:47 +00:00
1 parent b95fd6315c
commit 885605b439
5 files changed
+16 -14

No files matched your search

+1 -1
View File
@@ -53,7 +53,7 @@ class AttachmentsController < ApplicationController
end
verify :method => :post, :only => :destroy
verify :method => :delete, :only => :destroy
def destroy
# Make sure association callbacks are called
@attachment.container.attachments.delete(@attachment)
+2 -2
View File
@@ -4,9 +4,9 @@
<%= h(" - #{attachment.description}") unless attachment.description.blank? %>
<span class="size">(<%= number_to_human_size attachment.filesize %>)</span>
<% if options[:deletable] %>
<%= link_to image_tag('delete.png'), {:controller => 'attachments', :action => 'destroy', :id => attachment},
<%= link_to image_tag('delete.png'), attachment_path(attachment),
:confirm => l(:text_are_you_sure),
:method => :post,
:method => :delete,
:class => 'delete',
:title => l(:button_delete) %>
<% end %>
+2 -2
View File
@@ -33,8 +33,8 @@
<td class="downloads"><%= file.downloads %></td>
<td class="digest"><%= file.digest %></td>
<td align="center">
<%= link_to(image_tag('delete.png'), {:controller => 'attachments', :action => 'destroy', :id => file},
:confirm => l(:text_are_you_sure), :method => :post) if delete_allowed %>
<%= link_to(image_tag('delete.png'), attachment_path(file),
:confirm => l(:text_are_you_sure), :method => :delete) if delete_allowed %>
</td>
</tr>
<% end