You are on page 1of 8

Rails 3.

1 Asset Pipeline
Jeremy Olliver

Rails 3.1 Release Schedule


August 8th: Rails 3.1.0.rc6 August 22nd: Rails 3.1.0

Native Support for


Sass Coffeescript asset packaging/minication/compression cache friendly static lenames (hash in
lename not mtime querystring)

Assets Directory Structure


app assets javascripts stylesheets images optional: lib/assets (non-application specic assets) vendor/assets (third party assets, css/js plugins etc)

How Does it Work?


manifest les specify js/css les to load app/assets/javascripts/application.js app/assets/stylesheets/application.css Only needs changing for specifying load order Picks up coffeescript, javascript, css, and sass les

Coffeescript / JS compilation
provided through sprockets and execjs Need to include a javascript runtime such

as node.js or a native ruby implementation such as gems therubyracer or mustang

Sass / Compass / Referencing assets


use compass rails31 branch use sass (scss) its awesome referencing assets/images requires erb and
asset_path helper

Deployment
updated capistrano version coming up in the meantime: rake assets:precompile
RAILS_ENV=production

compiles to public/assets

You might also like