@@ -97,9 +97,11 module ApplicationHelper | |||||
97 | def link_to_attachment(attachment, options={}) |
|
97 | def link_to_attachment(attachment, options={}) | |
98 | text = options.delete(:text) || attachment.filename |
|
98 | text = options.delete(:text) || attachment.filename | |
99 | action = options.delete(:download) ? 'download' : 'show' |
|
99 | action = options.delete(:download) ? 'download' : 'show' | |
|
100 | opt_only_path = {} | |||
|
101 | opt_only_path[:only_path] = (options[:only_path] == false ? false : true) | |||
100 | link_to(h(text), |
|
102 | link_to(h(text), | |
101 | {:controller => 'attachments', :action => action, |
|
103 | {:controller => 'attachments', :action => action, | |
102 |
:id => attachment, :filename => attachment.filename |
|
104 | :id => attachment, :filename => attachment.filename}.merge(opt_only_path), | |
103 | options) |
|
105 | options) | |
104 | end |
|
106 | end | |
105 |
|
107 |
General Comments 0
You need to be logged in to leave comments.
Login now