Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Asset pipeline

3,038 views

Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Asset pipeline

  1. 1. RAILS ASSET PIPELINEBY STEVE BUTTERWORTH
  2. 2. THE PROBLEM
  3. 3. OLD SKOOLCONFIG/ENVIRONMENTS/PRODUCTION.RBAPP/VIEWS/LAYOUTS/APPLICATION.HTML.HAMLRESULTS IN...
  4. 4. JUST AIN’T GOOD ENOUGHNO MINIMIFICATIONINACCURATE CACHE STAMPNO ORGANIZATION
  5. 5. NU SKOOLAPP/ASSETS IS YOUR NEW HOME FOR CSS AND JSEACH CONTROLLER HAS ITS OWN CSS AND JS FILEPRE-PROCESS JS WITH ERB OR COFFEE-SCRIPTPRE-PROCESS CSS WITH SASS, LESS OR ERB
  6. 6. PRO-PROCESSINGPRE-PROCESSOR DETERMINED BY FILE EXTENSIONCHAIN PRE-PROCESSORS
  7. 7. PRE-PROCESS CSS WITH SASSSCSS SYNTAX GENERATED CSS
  8. 8. AS SIMPLE AS .... (ALMOST)YOU CAN USE THE SAME TAG HELPERS
  9. 9. MANIFESTSSPROCKETS MANIFEST APP/ASSETS/STYLESHEETS/APPLICATION.CSS WHEN ORDER MATTERS
  10. 10. DEBUGGING ASSETShttp://localhost.....http://localhost.....?debug_assets=true
  11. 11. CACHING- File includes MD5 hash of compiled content- 1 year max-age on cache-control headeraction_controller.perform_caching = true
  12. 12. COMPILE OFFLINE
  13. 13. SQUEEZE IT, SQUEEZE IT MORE COMPRESS STYLESHEETS (SCSS IS ONLY OPTION) COMPRESS JAVASCRIPT (UGLIFIER, YUI, CLOSURE)
  14. 14. RESOURCESHTTP://RAILSCASTS.COM/EPISODES/265-RAILS-3-1-OVERVIEWHTTP://WWW.YOUTUBE.COM/WATCH?V=CGDCI2HHFAUHTTP://GETSPROCKETS.ORG/HTTP://RYANBIGG.COM/GUIDES/ASSET_PIPELINE.HTML

×