I have this (these) model(s)
Portfolio
-- PortfolioItem item
-- Image image
has_attachment :attachment
all with nice slugs and I would want the url of :attachment to reflect this organization, such as with a instance
photos/holiday_in_venice/ponte_vecchio (all slugs of the respective hierarchy)
would generate this url
photos(??)/holiday_in_venice(??)/:slug/:style.:extension
how would I access these antecessor objects during paperclip path/url creation?
currently I am only able to do
ponte_vecchio/small.png
You’ll need to create custom interpolations. After that you are able define a
:urland a:path.Put a file called
paperclip.rbin yourconfig/initializers/folder and do something like this:After that you can use those interpolations like that: