use URL helper for attachment URL

pull/2358/head
Markus Kahl 10 years ago
parent 916b71b357
commit f553e5f5fe
  1. 5
      app/controllers/attachments_controller.rb

@ -75,10 +75,7 @@ class AttachmentsController < ApplicationController
if url.host # check if URL or file path
url.to_s
else
url_for controller: :attachments,
action: 'download',
filename: attachment.filename,
id: attachment.id
download_attachment_url filename: attachment.filename
end
end

Loading…
Cancel
Save