I have a rails 3.1 application that allows users to upload pictures. Should these pictures be stored as assets(in app/assets) and therefore be subject to Sprocket overhead(caching, fingerprinting, etc.)? Or should I keep them in public/images and store them outside of the asset pipeline?
Asked
Active
Viewed 1,081 times
7

New Alexandria
- 6,951
- 4
- 57
- 77

dhulihan
- 11,053
- 9
- 40
- 45
-
The asset pipeline is for organizing your assets, not for serving user-uploaded content. – user229044 Nov 02 '11 at 19:24
2 Answers
6
The asset/image is IMHO for structural/design images (background, icons, banners etc). Dynamically added pictures/assets should go in the public directory.

charlysisto
- 3,700
- 17
- 30
-
1I've done that, but I keep getting `No route matches [GET] "/system/files/694/large/772.jpg"` even though the file actually exists on the filesystem under `/public`. Any idea how to fix this routing issue? – Avishai Feb 15 '12 at 08:01
0
I've had this trouble and it was a permissions problem. If you are running under apache with the www-data user do this:
sudo chgrp -R www-data public
sudo chmod g+rws public

Charles Lemmon
- 26
- 3