I would like to save my rails images in folders corresponding to the post number an url like this:
www.domain.com/posts/21/pictures/1.jpg
the uploader is setup correctly but I can only access the pictures with the exact url and not with a relative path. When, on a show post view www.domain.com/posts/21
, I use a relative path such as:
src='pictures/1.jpg'
the image points to:
www.domain.com/posts/pictures/1.jpg
how can I make sure the base url includes the post number?