Skip to content

Instantly share code, notes, and snippets.

@ckaminer
Last active June 8, 2016 15:44
Show Gist options
  • Save ckaminer/964621a2ab3355902922e8cb1396e899 to your computer and use it in GitHub Desktop.
Save ckaminer/964621a2ab3355902922e8cb1396e899 to your computer and use it in GitHub Desktop.
asset pipeline review
What does it mean to concatenate files? Find an image of an example concatenated file. Why would we want to concatenate files?
- Concatenating files means to take all files of the same type and mash them into one master file. This leaves the application with less data.
What does it mean to precompile files? What does this have to do with coffeescript and sass files?
- Precompiling files is the process of compiling code down into its native language. Coffeescript would get compiled down to javascript and sass would get compiled to css.
What does it mean to minify files? Find an image of an example minified file. Why would we want to minify files?
- Minifying files is the process of removing whitespace, return lines, and long variable names (js) from a file. Minified files use less memory and are just as readable for the computer.
Start up the server for Catch 'em All (rails s) and navigate to http://localhost:3000/assets/application.js. Then open up the code for application.js in your text editor. Why are these not the same?
- The localhost display is showing all of the directive libraries from the manifest. The text editor is just declaring their existance. Localhost file is concatenated js file.
What is a manifest (in terms of the asset pipeline)? Where can you find two manifests in Catch 'em All?
In regular HTML files, we bring in css files with <link rel="stylesheet" href="application.css">. How is this done in a Rails project? Where do you see this line in Catch 'em All?
How is a digest/fingerprint used on the assets for caching purposes?
Done? Take a look at RailsGuides: The Asset Pipeline.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment