0

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 :)

dhaliman
  • 1,542
  • 1
  • 12
  • 23

1 Answers1

0

I assume that you should specify that in model where you attached paperclip. Look at this post. It looks same as you want to do . paperclip custom :path and :url

Jameson
  • 1
  • 2
  • 1