SlideShare a Scribd company logo
1 of 46
Asset Pipeline
    for dummies
Why?
Precompile
Concatenate
Minify
Sprockets performs the asset packaging which takes the assets from all the
specified paths, compiles them together and places them in the target path
(public/assets).
Tilt is the template engine that Sprockets uses. This allows file types like scss
and erb to be used in the asset pipeline.
Files in
     Asset Paths


Asset
Pipeline
Asset Paths
app/assets
  is for assets that are owned by the application, such as
  custom images, JavaScript files or stylesheets.
app/assets
   is for assets that are owned by the application, such as
   custom images, JavaScript files or stylesheets.


lib/assets
   is for your own libraries’ code that doesn’t really fit into the
   scope of the application or those libraries which are shared
   across applications.
app/assets
   is for assets that are owned by the application, such as
   custom images, JavaScript files or stylesheets.


lib/assets
   is for your own libraries’ code that doesn’t really fit into the
   scope of the application or those libraries which are shared
   across applications.


vendor/assets
   is for assets that are owned by outside entities, such as
   code for JavaScript plugins and CSS frameworks.
the manifest
• require [path] inserts the contents of the asset source file specified by path. If the file is
  required multiple times, it will appear in the bundle only once.
• require [path] inserts the contents of the asset source file specified by path. If the file is
  required multiple times, it will appear in the bundle only once.

• include [path] works like require, but inserts the contents of the specified source file even
  if it has already been included or required.
• require [path] inserts the contents of the asset source file specified by path. If the file is
  required multiple times, it will appear in the bundle only once.

• include [path] works like require, but inserts the contents of the specified source file even
  if it has already been included or required.

• require_directory [path] requires all source files of the same format in the directory
  specified by path. Files are required in alphabetical order.
• require [path] inserts the contents of the asset source file specified by path. If the file is
  required multiple times, it will appear in the bundle only once.

• include [path] works like require, but inserts the contents of the specified source file even
  if it has already been included or required.

• require_directory [path] requires all source files of the same format in the directory
  specified by path. Files are required in alphabetical order.

• require_tree [path] works like require_directory, but operates recursively to require all
  files in all subdirectories of the directory specified by path.
• require [path] inserts the contents of the asset source file specified by path. If the file is
  required multiple times, it will appear in the bundle only once.

• include [path] works like require, but inserts the contents of the specified source file even
  if it has already been included or required.

• require_directory [path] requires all source files of the same format in the directory
  specified by path. Files are required in alphabetical order.

• require_tree [path] works like require_directory, but operates recursively to require all
  files in all subdirectories of the directory specified by path.

• require_self tells Sprockets to insert the body of the current source file before any
  subsequent require or include directives.
• require [path] inserts the contents of the asset source file specified by path. If the file is
  required multiple times, it will appear in the bundle only once.

• include [path] works like require, but inserts the contents of the specified source file even
  if it has already been included or required.

• require_directory [path] requires all source files of the same format in the directory
  specified by path. Files are required in alphabetical order.

• require_tree [path] works like require_directory, but operates recursively to require all
  files in all subdirectories of the directory specified by path.

• require_self tells Sprockets to insert the body of the current source file before any
  subsequent require or include directives.

• depend_on [path] declares a dependency on the given path without including it in the
  bundle. This is useful when you need to expire an asset’s cache in response to a change in
  another file.
• require [path] inserts the contents of the asset source file specified by path. If the file is
  required multiple times, it will appear in the bundle only once.

• include [path] works like require, but inserts the contents of the specified source file even
  if it has already been included or required.

• require_directory [path] requires all source files of the same format in the directory
  specified by path. Files are required in alphabetical order.

• require_tree [path] works like require_directory, but operates recursively to require all
  files in all subdirectories of the directory specified by path.

• require_self tells Sprockets to insert the body of the current source file before any
  subsequent require or include directives.

• depend_on [path] declares a dependency on the given path without including it in the
  bundle. This is useful when you need to expire an asset’s cache in response to a change in
  another file.

• stub [path] allows dependency to be excluded from the asset bundle. The path must be a
  valid asset and may or may not already be part of the bundle. Once stubbed, it is
  blacklisted and can’t be brought back by any other require.
usage
Misconceptions
Files must belong in their respective paths.

For example, all JavaScript files must be in a javascripts folder within an
asset path.
Files must belong in their respective paths.

For example, all JavaScript files must be in a javascripts folder within an
asset path.


The truth is that the paths (stylesheets, javascripts,
images) are only there for organization.You can have
all the assets in a single folder or in a hundred.
Sass files need to use *erb* extension to allow for asset path inclusions
within the files.
Sass files need to use *erb* extension to allow for asset path inclusions
within the files.


The truth is that sass-rails provides -url and
-path helpers for the following asset types: image,
font, video, audio, JavaScript and stylesheet.
gems
faq
Why doesn't the auto-generated scss and coffeescript
only get included in their respective controller views?
Why doesn't the auto-generated scss and coffeescript
only get included in their respective controller views?
Do I have to use the asset pipeline?
Do I have to use the asset pipeline?
What happens if there are duplicate file
  names in different asset folders?
What happens if there are duplicate file
  names in different asset folders?
How can I precompile assets that aren't
     to be used in the pipeline?
How can I precompile assets that aren't
     to be used in the pipeline?
How can I precompile additional assets without
   having to include them in the manifest?
How can I precompile additional assets without
   having to include them in the manifest?
Precompile

Concatenate

  Minify
http://coderberry.me

More Related Content

What's hot

Deepak khetawat sling_models_sightly_jsp
Deepak khetawat sling_models_sightly_jspDeepak khetawat sling_models_sightly_jsp
Deepak khetawat sling_models_sightly_jspDEEPAK KHETAWAT
 
Sdec2011 shashank-introducing hadoop
Sdec2011 shashank-introducing hadoopSdec2011 shashank-introducing hadoop
Sdec2011 shashank-introducing hadoopKorea Sdec
 
Using existing language skillsets to create large-scale, cloud-based analytics
Using existing language skillsets to create large-scale, cloud-based analyticsUsing existing language skillsets to create large-scale, cloud-based analytics
Using existing language skillsets to create large-scale, cloud-based analyticsMicrosoft Tech Community
 
Modeling Tricks My Relational Database Never Taught Me
Modeling Tricks My Relational Database Never Taught MeModeling Tricks My Relational Database Never Taught Me
Modeling Tricks My Relational Database Never Taught MeDavid Boike
 
WordPress Theme Design and Development Workshop - Day 2
WordPress Theme Design and Development Workshop - Day 2WordPress Theme Design and Development Workshop - Day 2
WordPress Theme Design and Development Workshop - Day 2Mizanur Rahaman Mizan
 
Solr Recipes Workshop
Solr Recipes WorkshopSolr Recipes Workshop
Solr Recipes WorkshopErik Hatcher
 
Solr Black Belt Pre-conference
Solr Black Belt Pre-conferenceSolr Black Belt Pre-conference
Solr Black Belt Pre-conferenceErik Hatcher
 
WordPress Café: Using WordPress as a Framework
WordPress Café: Using WordPress as a FrameworkWordPress Café: Using WordPress as a Framework
WordPress Café: Using WordPress as a FrameworkExove
 
Flexible search in Apache Jackrabbit Oak
Flexible search in Apache Jackrabbit OakFlexible search in Apache Jackrabbit Oak
Flexible search in Apache Jackrabbit OakTommaso Teofili
 
Apache Hive micro guide - ConfusedCoders
Apache Hive micro guide - ConfusedCodersApache Hive micro guide - ConfusedCoders
Apache Hive micro guide - ConfusedCodersYash Sharma
 
Lucene for Solr Developers
Lucene for Solr DevelopersLucene for Solr Developers
Lucene for Solr DevelopersErik Hatcher
 
PuppetConf 2017: Hiera 5: The Full Data Enchilada- Hendrik Lindberg, Puppet
PuppetConf 2017: Hiera 5: The Full Data Enchilada- Hendrik Lindberg, PuppetPuppetConf 2017: Hiera 5: The Full Data Enchilada- Hendrik Lindberg, Puppet
PuppetConf 2017: Hiera 5: The Full Data Enchilada- Hendrik Lindberg, PuppetPuppet
 
Introduction to Solr
Introduction to SolrIntroduction to Solr
Introduction to SolrErik Hatcher
 
SBT by Aform Research, Saulius Valatka
SBT by Aform Research, Saulius ValatkaSBT by Aform Research, Saulius Valatka
SBT by Aform Research, Saulius ValatkaVasil Remeniuk
 
The Role of Atom/AtomPub in Digital Archive Services at The University of Tex...
The Role of Atom/AtomPub in Digital Archive Services at The University of Tex...The Role of Atom/AtomPub in Digital Archive Services at The University of Tex...
The Role of Atom/AtomPub in Digital Archive Services at The University of Tex...Peter Keane
 
Archiving in eZ Publish: What to do with all your content
Archiving in eZ Publish: What to do with all your contentArchiving in eZ Publish: What to do with all your content
Archiving in eZ Publish: What to do with all your contentPeter Keung
 
Custom PDFs from the DITA OT
Custom PDFs from the DITA OTCustom PDFs from the DITA OT
Custom PDFs from the DITA OTLeigh White
 

What's hot (20)

Deepak khetawat sling_models_sightly_jsp
Deepak khetawat sling_models_sightly_jspDeepak khetawat sling_models_sightly_jsp
Deepak khetawat sling_models_sightly_jsp
 
Sdec2011 shashank-introducing hadoop
Sdec2011 shashank-introducing hadoopSdec2011 shashank-introducing hadoop
Sdec2011 shashank-introducing hadoop
 
Using existing language skillsets to create large-scale, cloud-based analytics
Using existing language skillsets to create large-scale, cloud-based analyticsUsing existing language skillsets to create large-scale, cloud-based analytics
Using existing language skillsets to create large-scale, cloud-based analytics
 
Modeling Tricks My Relational Database Never Taught Me
Modeling Tricks My Relational Database Never Taught MeModeling Tricks My Relational Database Never Taught Me
Modeling Tricks My Relational Database Never Taught Me
 
Solr Flair
Solr FlairSolr Flair
Solr Flair
 
WordPress Theme Design and Development Workshop - Day 2
WordPress Theme Design and Development Workshop - Day 2WordPress Theme Design and Development Workshop - Day 2
WordPress Theme Design and Development Workshop - Day 2
 
Solr Recipes Workshop
Solr Recipes WorkshopSolr Recipes Workshop
Solr Recipes Workshop
 
Solr Black Belt Pre-conference
Solr Black Belt Pre-conferenceSolr Black Belt Pre-conference
Solr Black Belt Pre-conference
 
WordPress Café: Using WordPress as a Framework
WordPress Café: Using WordPress as a FrameworkWordPress Café: Using WordPress as a Framework
WordPress Café: Using WordPress as a Framework
 
Flexible search in Apache Jackrabbit Oak
Flexible search in Apache Jackrabbit OakFlexible search in Apache Jackrabbit Oak
Flexible search in Apache Jackrabbit Oak
 
Apache Hive micro guide - ConfusedCoders
Apache Hive micro guide - ConfusedCodersApache Hive micro guide - ConfusedCoders
Apache Hive micro guide - ConfusedCoders
 
Lucene for Solr Developers
Lucene for Solr DevelopersLucene for Solr Developers
Lucene for Solr Developers
 
PuppetConf 2017: Hiera 5: The Full Data Enchilada- Hendrik Lindberg, Puppet
PuppetConf 2017: Hiera 5: The Full Data Enchilada- Hendrik Lindberg, PuppetPuppetConf 2017: Hiera 5: The Full Data Enchilada- Hendrik Lindberg, Puppet
PuppetConf 2017: Hiera 5: The Full Data Enchilada- Hendrik Lindberg, Puppet
 
Introduction to Solr
Introduction to SolrIntroduction to Solr
Introduction to Solr
 
SBT by Aform Research, Saulius Valatka
SBT by Aform Research, Saulius ValatkaSBT by Aform Research, Saulius Valatka
SBT by Aform Research, Saulius Valatka
 
rtwerewr
rtwerewrrtwerewr
rtwerewr
 
The Role of Atom/AtomPub in Digital Archive Services at The University of Tex...
The Role of Atom/AtomPub in Digital Archive Services at The University of Tex...The Role of Atom/AtomPub in Digital Archive Services at The University of Tex...
The Role of Atom/AtomPub in Digital Archive Services at The University of Tex...
 
Introduction to Monsoon PHP framework
Introduction to Monsoon PHP frameworkIntroduction to Monsoon PHP framework
Introduction to Monsoon PHP framework
 
Archiving in eZ Publish: What to do with all your content
Archiving in eZ Publish: What to do with all your contentArchiving in eZ Publish: What to do with all your content
Archiving in eZ Publish: What to do with all your content
 
Custom PDFs from the DITA OT
Custom PDFs from the DITA OTCustom PDFs from the DITA OT
Custom PDFs from the DITA OT
 

Viewers also liked

Viewers also liked (6)

Ruby On Rails
Ruby On RailsRuby On Rails
Ruby On Rails
 
Ping-Pong Programming
Ping-Pong ProgrammingPing-Pong Programming
Ping-Pong Programming
 
Introduction To Grails
Introduction To GrailsIntroduction To Grails
Introduction To Grails
 
The Grails Framework.
The Grails Framework.The Grails Framework.
The Grails Framework.
 
Introduction To Grails
Introduction To GrailsIntroduction To Grails
Introduction To Grails
 
Groovy & Grails
Groovy & GrailsGroovy & Grails
Groovy & Grails
 

Similar to Asset Pipeline

Java Serialization Facts and Fallacies
Java Serialization Facts and FallaciesJava Serialization Facts and Fallacies
Java Serialization Facts and FallaciesRoman Elizarov
 
XOOPS 2.6.0 Assets Management using Assetic
XOOPS 2.6.0 Assets Management using AsseticXOOPS 2.6.0 Assets Management using Assetic
XOOPS 2.6.0 Assets Management using Asseticxoopsproject
 
Soa 32 packaging and deployment of soa components
Soa 32 packaging and deployment of soa componentsSoa 32 packaging and deployment of soa components
Soa 32 packaging and deployment of soa componentsVaibhav Khanna
 
BP-9 Share Customization Best Practices
BP-9 Share Customization Best PracticesBP-9 Share Customization Best Practices
BP-9 Share Customization Best PracticesAlfresco Software
 
Using elasticsearch with rails
Using elasticsearch with railsUsing elasticsearch with rails
Using elasticsearch with railsTom Z Zeng
 
DevOoops (Increase awareness around DevOps infra security) - VoxxedDays Ticin...
DevOoops (Increase awareness around DevOps infra security) - VoxxedDays Ticin...DevOoops (Increase awareness around DevOps infra security) - VoxxedDays Ticin...
DevOoops (Increase awareness around DevOps infra security) - VoxxedDays Ticin...Gianluca Varisco
 
BP-7 Share Customization Best Practices
BP-7 Share Customization Best PracticesBP-7 Share Customization Best Practices
BP-7 Share Customization Best PracticesAlfresco Software
 
Alfresco overview EDM
Alfresco overview EDMAlfresco overview EDM
Alfresco overview EDMsang nguyen
 
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 SurfAlfresco Software
 
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 SurfAlfresco Software
 
WordPress Themes 101 - dotEduGuru Summit 2013
WordPress Themes 101 - dotEduGuru Summit 2013WordPress Themes 101 - dotEduGuru Summit 2013
WordPress Themes 101 - dotEduGuru Summit 2013Curtiss Grymala
 
WordPress Themes 101 - HighEdWeb New England 2013
WordPress Themes 101 - HighEdWeb New England 2013WordPress Themes 101 - HighEdWeb New England 2013
WordPress Themes 101 - HighEdWeb New England 2013Curtiss Grymala
 
Rails 3.1 Asset pipeline
Rails 3.1 Asset pipelineRails 3.1 Asset pipeline
Rails 3.1 Asset pipelinejeremyolliver
 
Joes sass presentation
Joes sass presentationJoes sass presentation
Joes sass presentationJoeSeckelman
 
Solr Application Development Tutorial
Solr Application Development TutorialSolr Application Development Tutorial
Solr Application Development TutorialErik Hatcher
 
Html5 Brown Bag
Html5 Brown BagHtml5 Brown Bag
Html5 Brown Bagstuplum
 

Similar to Asset Pipeline (20)

Java Serialization Facts and Fallacies
Java Serialization Facts and FallaciesJava Serialization Facts and Fallacies
Java Serialization Facts and Fallacies
 
XOOPS 2.6.0 Assets Management using Assetic
XOOPS 2.6.0 Assets Management using AsseticXOOPS 2.6.0 Assets Management using Assetic
XOOPS 2.6.0 Assets Management using Assetic
 
Soa 32 packaging and deployment of soa components
Soa 32 packaging and deployment of soa componentsSoa 32 packaging and deployment of soa components
Soa 32 packaging and deployment of soa components
 
BP-9 Share Customization Best Practices
BP-9 Share Customization Best PracticesBP-9 Share Customization Best Practices
BP-9 Share Customization Best Practices
 
Using elasticsearch with rails
Using elasticsearch with railsUsing elasticsearch with rails
Using elasticsearch with rails
 
DevOoops (Increase awareness around DevOps infra security) - VoxxedDays Ticin...
DevOoops (Increase awareness around DevOps infra security) - VoxxedDays Ticin...DevOoops (Increase awareness around DevOps infra security) - VoxxedDays Ticin...
DevOoops (Increase awareness around DevOps infra security) - VoxxedDays Ticin...
 
Laravel ppt
Laravel pptLaravel ppt
Laravel ppt
 
Javasession6
Javasession6Javasession6
Javasession6
 
BP-7 Share Customization Best Practices
BP-7 Share Customization Best PracticesBP-7 Share Customization Best Practices
BP-7 Share Customization Best Practices
 
Cscope and ctags
Cscope and ctagsCscope and ctags
Cscope and ctags
 
Alfresco overview EDM
Alfresco overview EDMAlfresco overview EDM
Alfresco overview EDM
 
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
 
WordPress Themes 101 - dotEduGuru Summit 2013
WordPress Themes 101 - dotEduGuru Summit 2013WordPress Themes 101 - dotEduGuru Summit 2013
WordPress Themes 101 - dotEduGuru Summit 2013
 
WordPress Themes 101 - HighEdWeb New England 2013
WordPress Themes 101 - HighEdWeb New England 2013WordPress Themes 101 - HighEdWeb New England 2013
WordPress Themes 101 - HighEdWeb New England 2013
 
Rails 3.1 Asset pipeline
Rails 3.1 Asset pipelineRails 3.1 Asset pipeline
Rails 3.1 Asset pipeline
 
Asp folders and web configurations
Asp folders and web configurationsAsp folders and web configurations
Asp folders and web configurations
 
Joes sass presentation
Joes sass presentationJoes sass presentation
Joes sass presentation
 
Solr Application Development Tutorial
Solr Application Development TutorialSolr Application Development Tutorial
Solr Application Development Tutorial
 
Html5 Brown Bag
Html5 Brown BagHtml5 Brown Bag
Html5 Brown Bag
 

Recently uploaded

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?Igalia
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
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 WorkerThousandEyes
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
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 DevelopmentsTrustArc
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
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...apidays
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
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 DiscoveryTrustArc
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
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...Miguel Araújo
 

Recently uploaded (20)

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?
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
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
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
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
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
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...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
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
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
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...
 

Asset Pipeline

  • 1. Asset Pipeline for dummies
  • 6. Sprockets performs the asset packaging which takes the assets from all the specified paths, compiles them together and places them in the target path (public/assets).
  • 7. Tilt is the template engine that Sprockets uses. This allows file types like scss and erb to be used in the asset pipeline.
  • 8.
  • 9. Files in Asset Paths Asset Pipeline
  • 11.
  • 12.
  • 13. app/assets is for assets that are owned by the application, such as custom images, JavaScript files or stylesheets.
  • 14. app/assets is for assets that are owned by the application, such as custom images, JavaScript files or stylesheets. lib/assets is for your own libraries’ code that doesn’t really fit into the scope of the application or those libraries which are shared across applications.
  • 15. app/assets is for assets that are owned by the application, such as custom images, JavaScript files or stylesheets. lib/assets is for your own libraries’ code that doesn’t really fit into the scope of the application or those libraries which are shared across applications. vendor/assets is for assets that are owned by outside entities, such as code for JavaScript plugins and CSS frameworks.
  • 17.
  • 18. • require [path] inserts the contents of the asset source file specified by path. If the file is required multiple times, it will appear in the bundle only once.
  • 19. • require [path] inserts the contents of the asset source file specified by path. If the file is required multiple times, it will appear in the bundle only once. • include [path] works like require, but inserts the contents of the specified source file even if it has already been included or required.
  • 20. • require [path] inserts the contents of the asset source file specified by path. If the file is required multiple times, it will appear in the bundle only once. • include [path] works like require, but inserts the contents of the specified source file even if it has already been included or required. • require_directory [path] requires all source files of the same format in the directory specified by path. Files are required in alphabetical order.
  • 21. • require [path] inserts the contents of the asset source file specified by path. If the file is required multiple times, it will appear in the bundle only once. • include [path] works like require, but inserts the contents of the specified source file even if it has already been included or required. • require_directory [path] requires all source files of the same format in the directory specified by path. Files are required in alphabetical order. • require_tree [path] works like require_directory, but operates recursively to require all files in all subdirectories of the directory specified by path.
  • 22. • require [path] inserts the contents of the asset source file specified by path. If the file is required multiple times, it will appear in the bundle only once. • include [path] works like require, but inserts the contents of the specified source file even if it has already been included or required. • require_directory [path] requires all source files of the same format in the directory specified by path. Files are required in alphabetical order. • require_tree [path] works like require_directory, but operates recursively to require all files in all subdirectories of the directory specified by path. • require_self tells Sprockets to insert the body of the current source file before any subsequent require or include directives.
  • 23. • require [path] inserts the contents of the asset source file specified by path. If the file is required multiple times, it will appear in the bundle only once. • include [path] works like require, but inserts the contents of the specified source file even if it has already been included or required. • require_directory [path] requires all source files of the same format in the directory specified by path. Files are required in alphabetical order. • require_tree [path] works like require_directory, but operates recursively to require all files in all subdirectories of the directory specified by path. • require_self tells Sprockets to insert the body of the current source file before any subsequent require or include directives. • depend_on [path] declares a dependency on the given path without including it in the bundle. This is useful when you need to expire an asset’s cache in response to a change in another file.
  • 24. • require [path] inserts the contents of the asset source file specified by path. If the file is required multiple times, it will appear in the bundle only once. • include [path] works like require, but inserts the contents of the specified source file even if it has already been included or required. • require_directory [path] requires all source files of the same format in the directory specified by path. Files are required in alphabetical order. • require_tree [path] works like require_directory, but operates recursively to require all files in all subdirectories of the directory specified by path. • require_self tells Sprockets to insert the body of the current source file before any subsequent require or include directives. • depend_on [path] declares a dependency on the given path without including it in the bundle. This is useful when you need to expire an asset’s cache in response to a change in another file. • stub [path] allows dependency to be excluded from the asset bundle. The path must be a valid asset and may or may not already be part of the bundle. Once stubbed, it is blacklisted and can’t be brought back by any other require.
  • 25. usage
  • 26.
  • 28. Files must belong in their respective paths. For example, all JavaScript files must be in a javascripts folder within an asset path.
  • 29. Files must belong in their respective paths. For example, all JavaScript files must be in a javascripts folder within an asset path. The truth is that the paths (stylesheets, javascripts, images) are only there for organization.You can have all the assets in a single folder or in a hundred.
  • 30. Sass files need to use *erb* extension to allow for asset path inclusions within the files.
  • 31. Sass files need to use *erb* extension to allow for asset path inclusions within the files. The truth is that sass-rails provides -url and -path helpers for the following asset types: image, font, video, audio, JavaScript and stylesheet.
  • 32. gems
  • 33. faq
  • 34. Why doesn't the auto-generated scss and coffeescript only get included in their respective controller views?
  • 35. Why doesn't the auto-generated scss and coffeescript only get included in their respective controller views?
  • 36. Do I have to use the asset pipeline?
  • 37. Do I have to use the asset pipeline?
  • 38. What happens if there are duplicate file names in different asset folders?
  • 39. What happens if there are duplicate file names in different asset folders?
  • 40. How can I precompile assets that aren't to be used in the pipeline?
  • 41. How can I precompile assets that aren't to be used in the pipeline?
  • 42. How can I precompile additional assets without having to include them in the manifest?
  • 43. How can I precompile additional assets without having to include them in the manifest?
  • 45.

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n