fix attachment link has get parameter :class (#10602)

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9327 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2012-04-06 05:45:04 +00:00
parent f277f127c6
commit 8828c0f13e

View File

@ -97,9 +97,11 @@ module ApplicationHelper
def link_to_attachment(attachment, options={})
text = options.delete(:text) || attachment.filename
action = options.delete(:download) ? 'download' : 'show'
opt_only_path = {}
opt_only_path[:only_path] = (options[:only_path] == false ? false : true)
link_to(h(text),
{:controller => 'attachments', :action => action,
:id => attachment, :filename => attachment.filename }.merge(options),
:id => attachment, :filename => attachment.filename}.merge(opt_only_path),
options)
end