When you use rake assets:precompile
, Rails moves all of the assets from your app/assets
folder, to public/assets
. This is as a normal browser does not have access to your app
directory, but does have access to public
.
So, to answer your question, here are my thoughts. If your images are for your sites layout e.g logos or backgrounds, then you should store them in the app/assets/images
directory, however, if the images are user generated, such as profile images, then these should be stored directly in something such as public/images
. Ideally you would store those in S3 or a CDN, but you're already doing that.
As a bonus, Carrierwave, a Rails image upload gem, uses a public/images
type path as the default store for its images, as you can see in their config file:
# Override the directory where uploaded files will be stored.
# This is a sensible default for uploaders that are meant to be mounted:
def store_dir
"images/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end
Hope this helps!