# Paperclip s3 dynamic path

**URL:** <https://www.ruby-forum.com/t/paperclip-s3-dynamic-path/179526>\
**Category:** Rails\
**Created:** [November 27, 2009, 3:12am UTC](https://www.ruby-forum.com/t/paperclip-s3-dynamic-path/179526 "2009-11-27T03:12:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![s0nspark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f475e1/32.png) [@s0nspark](https://www.ruby-forum.com/u/s0nspark)\
**Post date:** [November 27, 2009, 3:12am UTC](https://www.ruby-forum.com/t/paperclip-s3-dynamic-path/179526/1 "2009-11-27T03:12:36Z")

</div>

Hi,

Is there a way to make the path dynamic using fields from the table that  
paperclip belongs (just like the id)?

Here’s what I have tried.

class Photo \< ActiveRecord::Base  
belongs\_to :event  
belongs\_to :photographer

has\_attached\_file :photo,  
:styles =\> { :thumb =\> “128x128\>”, :original =\>  
“328x328\>” },  
:path =\>  
“:photographer\_id/:event\_id/:id/:style.:extension”

end

Where :event\_id and :photographer\_id are fields from in the Photo model?

---

<div class="post-metadata">

**Author:** ![s0nspark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f475e1/32.png) [@s0nspark](https://www.ruby-forum.com/u/s0nspark)\
**Post date:** [November 27, 2009, 3:47am UTC](https://www.ruby-forum.com/t/paperclip-s3-dynamic-path/179526/2 "2009-11-27T03:47:56Z")

</div>

found solution:

[http://wiki.github.com/thoughtbot/paperclip/interpolations](http://wiki.github.com/thoughtbot/paperclip/interpolations)

Thanks
