You are on page 1of 11

Rails 3.

1 - Asset Pipeline
YEGRB - Edmonton Ruby UG - Jan 2012 @nathanbertram

Tuesday, January 17, 2012

~~~ Quick Poll ~~~

Tuesday, January 17, 2012

GIST: Asset Pipeline in Rails 3.1 Development: Encourages you to organize assets better. Supports great tools like: sass, coffeescript, etc... Production: Lets you serve optimized assets with ease without any sacrice in development.

Tuesday, January 17, 2012

GIST: Asset Pipeline in Rails 3.1 All thanks to Sprokets!

Tuesday, January 17, 2012

Development: Organize assets

Tuesday, January 17, 2012

Development: Organize assets


Assets are served by sprokets middleware from 3 places: 1. app/assets - assets that are owned by the application 2. lib/assets - your own libraries code 3. vendor/assets - assets owned by outside entities

Tuesday, January 17, 2012

Production: Optimized Assets.


- Pre-compiling automatically concatenates and compresses your assets. - Rails precompiles les in public/assets by default. - The precompiled copies are served as static assets by the web server. - The les in app/assets are never served directly!

Tuesday, January 17, 2012

Production: Optimized Assets


- Rails inserts an MD5 ngerprint into each lename so that the le is cached by the web browser. - You can invalidate the cache by altering this ngerprint, which happens automatically whenever you change the le contents.

Tuesday, January 17, 2012

Tuesday, January 17, 2012

Thanks!
Tuesday, January 17, 2012

Questions?

Tuesday, January 17, 2012