SlideShare a Scribd company logo
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_jsp
DEEPAK KHETAWAT
 
Sdec2011 shashank-introducing hadoop
Sdec2011 shashank-introducing hadoopSdec2011 shashank-introducing hadoop
Sdec2011 shashank-introducing hadoop
Korea 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 analytics
Microsoft 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 Me
David Boike
 
Solr Flair
Solr FlairSolr Flair
Solr Flair
Erik Hatcher
 
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
Mizanur Rahaman Mizan
 
Solr Recipes Workshop
Solr Recipes WorkshopSolr Recipes Workshop
Solr Recipes Workshop
Erik Hatcher
 
Solr Black Belt Pre-conference
Solr Black Belt Pre-conferenceSolr Black Belt Pre-conference
Solr Black Belt Pre-conference
Erik 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 Framework
Exove
 
Flexible search in Apache Jackrabbit Oak
Flexible search in Apache Jackrabbit OakFlexible search in Apache Jackrabbit Oak
Flexible search in Apache Jackrabbit Oak
Tommaso Teofili
 
Apache Hive micro guide - ConfusedCoders
Apache Hive micro guide - ConfusedCodersApache Hive micro guide - ConfusedCoders
Apache Hive micro guide - ConfusedCoders
Yash Sharma
 
Lucene for Solr Developers
Lucene for Solr DevelopersLucene for Solr Developers
Lucene for Solr Developers
Erik 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, Puppet
Puppet
 
Introduction to Solr
Introduction to SolrIntroduction to Solr
Introduction to Solr
Erik Hatcher
 
SBT by Aform Research, Saulius Valatka
SBT by Aform Research, Saulius ValatkaSBT by Aform Research, Saulius Valatka
SBT by Aform Research, Saulius Valatka
Vasil Remeniuk
 
rtwerewr
rtwerewrrtwerewr
rtwerewr
esolinhighered
 
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
 
Introduction to Monsoon PHP framework
Introduction to Monsoon PHP frameworkIntroduction to Monsoon PHP framework
Introduction to Monsoon PHP framework
Krishna Srikanth Manda
 
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
Peter Keung
 
Custom PDFs from the DITA OT
Custom PDFs from the DITA OTCustom PDFs from the DITA OT
Custom PDFs from the DITA OT
Leigh 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

Ruby On Rails
Ruby On RailsRuby On Rails
Ruby On Rails
Eric Berry
 
Ping-Pong Programming
Ping-Pong ProgrammingPing-Pong Programming
Ping-Pong Programming
Eric Berry
 
Introduction To Grails
Introduction To GrailsIntroduction To Grails
Introduction To Grails
Christopher Bartling
 
The Grails Framework.
The Grails Framework.The Grails Framework.
The Grails Framework.
melidevelopers
 
Introduction To Grails
Introduction To GrailsIntroduction To Grails
Introduction To Grails
Eric Berry
 
Groovy & Grails
Groovy & GrailsGroovy & Grails
Groovy & Grails
Marcel Overdijk
 

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 Fallacies
Roman 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 Assetic
xoopsproject
 
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
Vaibhav Khanna
 
BP-9 Share Customization Best Practices
BP-9 Share Customization Best PracticesBP-9 Share Customization Best Practices
BP-9 Share Customization Best Practices
Alfresco Software
 
Using elasticsearch with rails
Using elasticsearch with railsUsing elasticsearch with rails
Using elasticsearch with rails
Tom 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
 
Laravel ppt
Laravel pptLaravel ppt
Laravel ppt
Mayank Panchal
 
Javasession6
Javasession6Javasession6
Javasession6
Rajeev Kumar
 
BP-7 Share Customization Best Practices
BP-7 Share Customization Best PracticesBP-7 Share Customization Best Practices
BP-7 Share Customization Best Practices
Alfresco Software
 
Cscope and ctags
Cscope and ctagsCscope and ctags
Cscope and ctags
Saikat Megamind
 
Alfresco overview EDM
Alfresco overview EDMAlfresco overview EDM
Alfresco overview EDM
sang 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 Surf
Alfresco 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 Surf
Alfresco Software
 
WordPress Themes 101 - dotEduGuru Summit 2013
WordPress Themes 101 - dotEduGuru Summit 2013WordPress Themes 101 - dotEduGuru Summit 2013
WordPress Themes 101 - dotEduGuru Summit 2013
Curtiss 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 2013
Curtiss Grymala
 
Rails 3.1 Asset pipeline
Rails 3.1 Asset pipelineRails 3.1 Asset pipeline
Rails 3.1 Asset pipeline
jeremyolliver
 
Asp folders and web configurations
Asp folders and web configurationsAsp folders and web configurations
Asp folders and web configurations
baabtra.com - No. 1 supplier of quality freshers
 
Joes sass presentation
Joes sass presentationJoes sass presentation
Joes sass presentation
JoeSeckelman
 
Solr Application Development Tutorial
Solr Application Development TutorialSolr Application Development Tutorial
Solr Application Development Tutorial
Erik Hatcher
 
Html5 Brown Bag
Html5 Brown BagHtml5 Brown Bag
Html5 Brown Bag
stuplum
 

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

Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
Zilliz
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 

Recently uploaded (20)

Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 

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