This card was replaced by Frontend build pipelines in Rails
The asset pipeline is one of Rails' two mechanisms how stylesheets, javascripts and images from your /assets
folder are processed and delivered to the browser. Rails has a second pipeline called webpacker, which we will cover later.
require
, require_tree
, require_self
do?image-url
and font-url
necessary for sass urls?@import other_file
.//= require 'other_file
'.In your MovieDB, add the following line to your config/environments/development.rb
:
config.assets.compile = false
config.assets.debug = false
Then restart your server. This mimicks how applications work in production.
Now reload your page. It will probably show an exception or have broken stylesheets or Javascript. Try to get everything working again. You will need rake assets:precompile
.
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.rb
again and run rake assets:clobber
. Keep other changes.
In your MovieDB, take a look at your Javascript files. Are they organized like your ruby code, where every functional component lives in its own file in an appropriate directory?
If not, reorganize them using the asset pipeline.