Rails 3.1Asset 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/minification/compression• cache friendly static filenames (hash in  ...
Assets Directory             Structureapp assets   javascripts   stylesheets   imagesoptional:lib/assets (non-application ...
How Does it Work?• manifest files specify js/css files to load• app/assets/javascripts/application.js• app/assets/stylesheet...
Coffeescript / JS       compilation• provided through sprockets and execjs• Need to include a javascript runtime such  as ...
Sass / Compass /    Referencing assets• use compass ‘rails31’ branch• use sass (scss) it’s awesome• referencing assets/ima...
Deployment• updated capistrano version coming up• in the meantime: • rake assets:precompile    RAILS_ENV=production• compi...
Upcoming SlideShare
Loading in...5
×

Rails 3.1 Asset pipeline

1,153
-1

Published on

Slides from my presentation at WellRailed (27th July 2011)

Additional Links: http://ryanbigg.com/guides/asset_pipeline.html

twitter: @static_storm
blog: http://incitecode.com

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,153
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
9
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Rails 3.1 Asset pipeline

  1. 1. Rails 3.1Asset Pipeline Jeremy Olliver
  2. 2. Rails 3.1 Release Schedule• August 8th: Rails 3.1.0.rc6• August 22nd: Rails 3.1.0
  3. 3. Native Support for• Sass• Coffeescript• asset packaging/minification/compression• cache friendly static filenames (hash in filename not mtime querystring)
  4. 4. Assets Directory Structureapp assets javascripts stylesheets imagesoptional:lib/assets (non-application specific assets)vendor/assets (third party assets, css/js plugins etc)
  5. 5. How Does it Work?• manifest files specify js/css files 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 files
  6. 6. 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’
  7. 7. Sass / Compass / Referencing assets• use compass ‘rails31’ branch• use sass (scss) it’s awesome• referencing assets/images requires erb and asset_path helper
  8. 8. Deployment• updated capistrano version coming up• in the meantime: • rake assets:precompile RAILS_ENV=production• compiles to public/assets
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×