7

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?

New Alexandria
  • 6,951
  • 4
  • 57
  • 77
dhulihan
  • 11,053
  • 9
  • 40
  • 45

2 Answers2

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
  • 1
    I'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