The asset pipeline [2d]
/assets folder are processed and delivered to the browser.
You have certainly already used it, but maybe do not know what happens behind the scenes.
- Read Everything You Should Know About the Rails Asset Pipeline
- Read How to make your application assets cachable in Rails
- Read Managing vendor libraries with the Rails asset pipeline
- What is "sprockets" and how does it relate to the asset pipeline?
- What is a "manifest"? What does
- What is "asset minification" and why is it necessary?
- What is "asset concatenation" and why is it necessary?
- What is "asset fingerprinting" and why is it necessary?
- What is "precompiling"? How and when does it happen?
- Why are the
font-urlnecessary for sass urls?
- What are "expiry" or "cache-control" headers? How do those work for our applications?
- When importing variables or mixins into a .sass file, we need to use
@import other_file. We cannot use
//= require 'other_file. Do you understand why?
Exercise: Precompile your assets
In your MovieDB, add the following line to your
config.assets.compile = false config.assets.debug = false
Then restart your server. This mimicks how applications work in production.
If you have trouble understanding why stuff does not work, read our card Rails asset pipeline: Why things break in production and what precompilation does to your assets
When you're done, remove the lines from your
development.rbagain and run
rake assets:clobber. Keep other changes.
If not, reorganize them using the asset pipeline.