I'm quite baffled/agitated by this. I'm using paperclip to allow upload
of images to my application. This is working fine, it's saving the the
images exactly where its supposed to and it's saving the image objects
as its supposed to.
The problem is that I can't display these images in the browser. I've
had this issue in a couple other applications I've made and just got
around it by having paperclip save to the public folder and pull from
there to display the desired image. But I feel as though I should get
this sorted out.
Unless you've got an ImagesController (not shown here), the :url
argument you're using is the problem. Files in the public directory
are served as-is, so yours will be in /
uploaded/:attachable_type/:attachable_id/:id_:style.:extension
Though I'm still not getting this to work. Where do I go from here?
I created the images_controller and created routes for them. I looked
into this and saw some one else doing this in their controller to handle
'documents' (pdfs, jpgs, pngs, etc)
For those of you who recommend the public folder, the only problem with
that for me and I'm sure others is that we may want some uploads to be
private, and prevent users from simply browsing the public directory on
our webapps to look at every-bodies uploads. By using our own custom
folders we can prevent this with very little code.