SlideShare uma empresa Scribd logo
1 de 8
Baixar para ler offline
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/minification/compression
• cache friendly static filenames (hash in
  filename not mtime querystring)
Assets Directory
             Structure
app
 assets
   javascripts
   stylesheets
   images

optional:
lib/assets (non-application specific assets)
vendor/assets (third party assets, css/js plugins etc)
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
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) it’s 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

Mais conteúdo relacionado

Mais procurados

Intro to SPA using JavaScript & ASP.NET
Intro to SPA using JavaScript & ASP.NETIntro to SPA using JavaScript & ASP.NET
Intro to SPA using JavaScript & ASP.NET
Alan Hecht
 
Rupy2012 ArangoDB Workshop Part2
Rupy2012 ArangoDB Workshop Part2Rupy2012 ArangoDB Workshop Part2
Rupy2012 ArangoDB Workshop Part2
ArangoDB Database
 
Jasig rubyon rails
Jasig rubyon railsJasig rubyon rails
Jasig rubyon rails
_zaMmer_
 

Mais procurados (20)

Serverless in azure
Serverless in azureServerless in azure
Serverless in azure
 
Intro to SPA using JavaScript & ASP.NET
Intro to SPA using JavaScript & ASP.NETIntro to SPA using JavaScript & ASP.NET
Intro to SPA using JavaScript & ASP.NET
 
Rails 3 Asset Pipeline
Rails 3 Asset PipelineRails 3 Asset Pipeline
Rails 3 Asset Pipeline
 
Introduction 2 to aws and storage options
Introduction 2 to aws and storage optionsIntroduction 2 to aws and storage options
Introduction 2 to aws and storage options
 
Asp.net
Asp.netAsp.net
Asp.net
 
Rupy2012 ArangoDB Workshop Part2
Rupy2012 ArangoDB Workshop Part2Rupy2012 ArangoDB Workshop Part2
Rupy2012 ArangoDB Workshop Part2
 
Architecture - why so serious?
Architecture - why so serious?Architecture - why so serious?
Architecture - why so serious?
 
Easy Object Storage Import/Export Using the S3 Connector on Jetstream
Easy Object Storage Import/Export Using the S3 Connector on JetstreamEasy Object Storage Import/Export Using the S3 Connector on Jetstream
Easy Object Storage Import/Export Using the S3 Connector on Jetstream
 
Wikipedia Cloud Search Webinar
Wikipedia Cloud Search WebinarWikipedia Cloud Search Webinar
Wikipedia Cloud Search Webinar
 
Training on iOS app development - Samesh Swongamikha & Neetin Sharma
Training on iOS app development - Samesh Swongamikha & Neetin SharmaTraining on iOS app development - Samesh Swongamikha & Neetin Sharma
Training on iOS app development - Samesh Swongamikha & Neetin Sharma
 
Node ts1
Node ts1Node ts1
Node ts1
 
Backbonification for dummies - Arrrrug 10/1/2012
Backbonification for dummies - Arrrrug 10/1/2012Backbonification for dummies - Arrrrug 10/1/2012
Backbonification for dummies - Arrrrug 10/1/2012
 
Cloud Computing Training
Cloud Computing TrainingCloud Computing Training
Cloud Computing Training
 
Short introduction to Redis
Short introduction to RedisShort introduction to Redis
Short introduction to Redis
 
Building a spa_in_30min
Building a spa_in_30minBuilding a spa_in_30min
Building a spa_in_30min
 
Jasig rubyon rails
Jasig rubyon railsJasig rubyon rails
Jasig rubyon rails
 
Being With Rails App For 3 Years
Being With Rails App For 3 YearsBeing With Rails App For 3 Years
Being With Rails App For 3 Years
 
Rails engines
Rails enginesRails engines
Rails engines
 
Signal rity1
Signal rity1Signal rity1
Signal rity1
 
Node.js server side render in the Age of APIs - Full Stack Toronto 2017
 Node.js server side render in the Age of APIs - Full Stack Toronto 2017 Node.js server side render in the Age of APIs - Full Stack Toronto 2017
Node.js server side render in the Age of APIs - Full Stack Toronto 2017
 

Destaque (7)

Networks and Distance Learning
Networks and Distance LearningNetworks and Distance Learning
Networks and Distance Learning
 
Our universe
Our universeOur universe
Our universe
 
Multimedia presentation
Multimedia presentationMultimedia presentation
Multimedia presentation
 
Multimedia presentation
Multimedia presentationMultimedia presentation
Multimedia presentation
 
Multimedia presentation
Multimedia presentationMultimedia presentation
Multimedia presentation
 
Multimedia presentation
Multimedia presentationMultimedia presentation
Multimedia presentation
 
Vero
VeroVero
Vero
 

Semelhante a Rails 3.1 Asset pipeline

An architecture for federated data discovery and lineage over on-prem datasou...
An architecture for federated data discovery and lineage over on-prem datasou...An architecture for federated data discovery and lineage over on-prem datasou...
An architecture for federated data discovery and lineage over on-prem datasou...
DataWorks Summit
 

Semelhante a Rails 3.1 Asset pipeline (20)

OSGi, Scripting and REST, Building Webapps With Apache Sling
OSGi, Scripting and REST, Building Webapps With Apache SlingOSGi, Scripting and REST, Building Webapps With Apache Sling
OSGi, Scripting and REST, Building Webapps With Apache Sling
 
Understanding asset pipeline plugin
Understanding asset pipeline pluginUnderstanding asset pipeline plugin
Understanding asset pipeline plugin
 
Asset Pipeline in Ruby on Rails
Asset Pipeline in Ruby on RailsAsset Pipeline in Ruby on Rails
Asset Pipeline in Ruby on Rails
 
PLAT-7 Spring Web Scripts and Spring Surf
PLAT-7 Spring Web Scripts and Spring SurfPLAT-7 Spring Web Scripts and Spring Surf
PLAT-7 Spring Web Scripts and Spring Surf
 
PLAT-7 Spring Web Scripts and Spring Surf
PLAT-7 Spring Web Scripts and Spring SurfPLAT-7 Spring Web Scripts and Spring Surf
PLAT-7 Spring Web Scripts and Spring Surf
 
PLAT-16 Using Enterprise Content in Grails
PLAT-16 Using Enterprise Content in GrailsPLAT-16 Using Enterprise Content in Grails
PLAT-16 Using Enterprise Content in Grails
 
Rails 3.1
Rails 3.1Rails 3.1
Rails 3.1
 
PLAT-8 Spring Web Scripts and Spring Surf
PLAT-8 Spring Web Scripts and Spring SurfPLAT-8 Spring Web Scripts and Spring Surf
PLAT-8 Spring Web Scripts and Spring Surf
 
Local Testing and Deployment Best Practices for Serverless Applications - AWS...
Local Testing and Deployment Best Practices for Serverless Applications - AWS...Local Testing and Deployment Best Practices for Serverless Applications - AWS...
Local Testing and Deployment Best Practices for Serverless Applications - AWS...
 
Local Testing and Deployment Best Practices for Serverless Applications - AWS...
Local Testing and Deployment Best Practices for Serverless Applications - AWS...Local Testing and Deployment Best Practices for Serverless Applications - AWS...
Local Testing and Deployment Best Practices for Serverless Applications - AWS...
 
Deep Dive: Alfresco Core Repository (... embedded in a micro-services style a...
Deep Dive: Alfresco Core Repository (... embedded in a micro-services style a...Deep Dive: Alfresco Core Repository (... embedded in a micro-services style a...
Deep Dive: Alfresco Core Repository (... embedded in a micro-services style a...
 
An Intense Overview of the React Ecosystem
An Intense Overview of the React EcosystemAn Intense Overview of the React Ecosystem
An Intense Overview of the React Ecosystem
 
Create a new project in ROR
Create a new project in RORCreate a new project in ROR
Create a new project in ROR
 
Spring 3.1 in a Nutshell - JAX London 2011
Spring 3.1 in a Nutshell - JAX London 2011Spring 3.1 in a Nutshell - JAX London 2011
Spring 3.1 in a Nutshell - JAX London 2011
 
Spring Day | Spring 3.1 in a Nutshell | Sam Brannen
Spring Day | Spring 3.1 in a Nutshell | Sam BrannenSpring Day | Spring 3.1 in a Nutshell | Sam Brannen
Spring Day | Spring 3.1 in a Nutshell | Sam Brannen
 
An architecture for federated data discovery and lineage over on-prem datasou...
An architecture for federated data discovery and lineage over on-prem datasou...An architecture for federated data discovery and lineage over on-prem datasou...
An architecture for federated data discovery and lineage over on-prem datasou...
 
Stacktician - CloudStack Collab Conference 2014
Stacktician - CloudStack Collab Conference 2014Stacktician - CloudStack Collab Conference 2014
Stacktician - CloudStack Collab Conference 2014
 
Scaling horizontally on AWS
Scaling horizontally on AWSScaling horizontally on AWS
Scaling horizontally on AWS
 
Rails - getting started
Rails - getting startedRails - getting started
Rails - getting started
 
Rails api + JS app
Rails api + JS appRails api + JS app
Rails api + JS app
 

Último

Último (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 

Rails 3.1 Asset pipeline

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