Understanding the Asset Pipeline in Ruby on Rails
Web-Crunch
Hi, My name is Andy Leverenz and I work as a Product Designer at Dribbble. For fun, I design, code, and write. Check out my blog called Web-Crunch https://web-crunch.com where I publish design and development tutorials with the occasional vlog.
====================
The asset pipeline has been a game changer for a number of years in the Ruby on Rails community. This article & video is an overview of what the asset pipeline is, how it's used, and the benefits of such a tool.
What is the asset pipeline?
The Ruby on Rails documentation does a great job explaining the "what".
"The asset pipeline provides a framework to concatenate and minify or compress JavaScript and CSS assets. It also adds the ability to write these assets in other languages and pre-processors such as CoffeeScript, Sass, and ERB. It allows assets in your application to be automatically combined with assets from other gems."
Main Features
A generalized perk of using the Asset Pipeline is for performance and speed. Among those generalized gains we get the following:
File concatenation - serving fewer files means fewer requests your browser has to make.
SHA256 fingerprint - Cache files automatically with fingerprints. Update only the files that need to be.
Minification / Compression - Minification means smaller file sizes and less "bytes" to serve per request.
Continue reading: https://web-crunch.com/understanding-asset-pipeline-ruby-on-rails
Note: Right around 20:08 I try and require "log.js". It turns out you don't even need to require it thanks to the "require_tree . " declaration below it in the same file. I also spelled "require" wrong.π€¦πΌββοΈ I just wanted to clear that up!
====================
π° Subscribe: https://www.youtube.com/user/webcrunchblog?sub_confirmation=1
ππ€ NEW COURSE: HELLO RAILS - Get notified Https://hellorails.io
π» Previously published at: https://web-crunch.com/understanding-asset-pipeline-ruby-on-rails
π» Check out the blog: https://web-crunch.com
π¦ Check out my personal site: https://justalever.com
π Links: Weekly Newsletter: https://web-crunch.com/subscribe Twitter: https://twitter.com/webcrunchblog Twitter(Personal Account): https://twitter.com/justalever Facebook: https://facebook.com/webcrunchblog Dribbble: https://dribbble.com/justalever Github: https://github.com/justalever Medium: https://medium.com/the-web-crunch-publication
πCheck out my book on UX Design: "LUXD: Learn User Experience Design" https://web-crunch.com/books/luxd
π Check out my FREE book on Tumblr Theming: "Pro Tumblr Theming" https://web-crunch.com/books/ptt
π― Need awesome web hosting? Check out cloudways. They allow me to use a variety of hosting providers and build apps with ease: http://bit.ly/webcrunchhosting
π Need more advanced hosting for Rails, PHP, Node, or other projects? Digital Ocean has you covered. https://m.do.co/c/ee243ee15648
π Ruby on Rails devs, Try HatchBox.io. You'll save upwards of 50% compared to Heroku. I use it and love it! https://hatchbox.io/?via=andy
βοΈ Or buy me a coffee https://www.buymeacoffee.com/webcrunch ... https://www.youtube.com/watch?v=kgEcdBGpr54
201026436 Bytes