SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Andere mochten auch

Andere mochten auch (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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Kürzlich hochgeladen

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
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 Processorsdebabhi2
 
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 2024Rafal Los
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
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?Antenna Manufacturer Coco
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
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
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 

Kürzlich hochgeladen (20)

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
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
 
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
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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?
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 

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.

Hinweis der Redaktion

  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