]> source.dussan.org Git - redmine.git/commitdiff
Use helper.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 14 Jan 2013 21:13:09 +0000 (21:13 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 14 Jan 2013 21:13:09 +0000 (21:13 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11190 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/application_helper.rb

index cd5f6006397cbb5cbc0a0a9d871964b0a7e2370f..e181eea54a60e4b35e8a52ee32eb091e2a69823d 100644 (file)
@@ -775,8 +775,7 @@ module ApplicationHelper
           when 'attachment'
             attachments = options[:attachments] || (obj && obj.respond_to?(:attachments) ? obj.attachments : nil)
             if attachments && attachment = attachments.detect {|a| a.filename == name }
-              link = link_to h(attachment.filename), {:only_path => only_path, :controller => 'attachments', :action => 'download', :id => attachment},
-                                                     :class => 'attachment'
+              link = link_to_attachment(attachment, :only_path => only_path, :download => true, :class => 'attachment')
             end
           when 'project'
             if p = Project.visible.where("identifier = :s OR LOWER(name) = :s", :s => name.downcase).first