user1848436
user1848436

Reputation: 7

Paperclip original url

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

Answers (1)

davogones
davogones

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

Related Questions