I'm using Rails 5.1 and Paperclip to upload attachments.
I've created an Attachment
model which has an attached file called document
. Attachment
belongs to the model Entry
.
I wanted the default url for the attachments to be on the format /admin/entries/:entry_id/attachments/attachment_name
and the storage path to be of the format /public/entries/:entry_id/attachment_name
.
I looked into the Paperclip wiki but I couldn't find a way to get :entry_id
in the url.
Would anyone know how to do this?
Thanks :)