Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Assets on Rails na Prática

Ramon Bispo
December 17, 2012

Assets on Rails na Prática

Entendendo, configurando e aplicando a estrutura de assets do Rails.

Ramon Bispo

December 17, 2012
Tweet

More Decks by Ramon Bispo

Other Decks in Programming

Transcript

  1. UM POUCO DE HISTÓRIA Rails < 3.1 - Jammit http://documentcloud.github.com/jammit/

    - Asset Packager https://github.com/sbecker/asset_packager Rails 3.1+ - Sprockets https://github.com/sstephenson/sprockets @RAMONPAGE
  2. ESTRUTURA DOS ASSETS NO RAILS @RAMONPAGE ↳ app ↳ assets

    ↳ images - ... ↳ javascripts - application.js - ... ↳ stylesheets - application.css - ... ↳ ...
  3. @RAMONPAGE ENTENDENDO OS MANIFESTOS application.js //= require jquery //= require

    jquery_ujs //= require_tree . application.css /* *= require_self *= require_tree . */
  4. @RAMONPAGE SASS EM USO .CSS .content-navigation { border-color: #3bbfce; color:

    #2b9eab; } .border { padding: 8px; margin: 8px; border-color: #3bbfce; } .SASS $blue: #3bbfce $margin: 16px .content-navigation border-color: $blue color: darken($blue, 9%) .border padding: $margin / 2 margin: $margin / 2 border-color: $blue