Happy Bear Software

Put Rails assets in the right place

There are three directories where your assets live in Ruby on Rails codebase:

Each of them have a distinct use case:

One of the nice things about the Ruby on Rails framework is the idea of a place for everything and everything in its place. By sticking to Rails conventions, you make it easier for new developers (or yourself a few months from now) to reason about the codebase. A surprisingly large number of codebases completely forego this benefit of Rails by ignoring the conventions.

Another bugbear of mine: there's no point in committing minified vendor code. The Rails asset pipeline will minify your code in production anyway (minifying it twice won't make it "extra" small). The benefit of keeping the full source in your repo is being able to debug it by reading the code.