Search code examples
ruby-on-railsimageasset-management

Image organization strategy with Rails & Sass


As the quantity of our pages increases, the number of images in the rails project has increased greatly. Does anyone have a good strategy for keeping track of these images?

We have experimented with a couple ideas but nothing seems to solve everything. Here are the high level requirements we have come up with:

  • Images should be available to any developer locally (given they have code access).
  • Updated images can be automatically sent to amazon s3 (and out to cloud front) on deploy
  • An easy way to "expire" an image when it changes forcing browsers to download instead of using a cached version

Solution

  • We actually deployed a Rake Task to archive this and keep all the files between our application and (in our case) Cloudfiles in sync.

    The rake tasks checks for new files or files that have been changed and uploads them to Cloudfiles. If a developer adds an asset, they can just run the rake task and update the cloud. They also check in the file into our version control so other dev's have access to it.