Reputation: 7
I need to get the file system url for the file uploaded by Paperclip. I tried doing this
ProjectAttachment.last.attachment.url
ProjectAttachment Load (0.6ms)
SELECT `project_attachments`.* FROM `project_attachments`
ORDER BY `project_attachments`.`id` DESC LIMIT 1 => "/system/project_attachments/attachments/000/000/014/original/Updated_test_v1_2a.xlsx?1367191020"
Why is it adding ?1367191020
after the file? Is there a way to make sure that doesn't get added to URL?
Upvotes: 0
Views: 217
Reputation: 7399
According to the method documentation, a timestamp is added to the end of the url by default. So change your code to:
ProjectAttachment.last.attachment.url(:timestamp => false)
Upvotes: 1