I played using Paperclip to create a photo gallery / store. There are many photos in the Gallery, and the photo belongs to the gallery, and users can have many Gallery. The default options for paperclip do something like /:class/:style/:basename.:extension. However, with the gallery setup, I would rather want something like /:class/:user_name/:gallery_name/:styles/:basename.:extension. I have not yet found a way to access variables in an object to dynamically create these storage locations.
Is there any way to do this?
I tried using # {variable} in the path, but this does not work. These photo objects are created using @ gallery.photos.build, so gallery_id should already have an accessible value.
source
share