The asset pipeline provides a framework to concatenate and minify or compress JavaScript and CSS assets. It also adds the ability to write these assets in other languages and pre-processors such as CoffeeScript, Sass and ERB.
The asset pipeline is a feature added to Ruby on Rails 3.1 to provide improved organization and processing for JavaScript, stylesheets, and images. There also exists a Grails plugin named asset-pipeline that provides equivalent functionality to applications developed for this framework.
These assets can be separated into folders under app/assets/
for those that are application-specific, lib/assets/
for assets shared across multiple applications, and vendor/assets/
for third-party assets. Each of those folders would have subfolders like javascripts/
, stylesheets/
and images/
.
This is meant to eliminate what Ruby on Rails creator David Heinemeier Hansson calls the "junk drawer" approach of putting all JavaScript code (for example) in the same folder, regardless of source.
Additionally, as Ryan Bigg has documented:
The asset pipeline provides a framework to concatenate and minify or compress JavaScript and CSS assets. It also adds the ability to write these assets in other languages such as CoffeeScript, SCSS and ERB. -- Rails Guides