Skip to content

Instantly share code, notes, and snippets.

@dtinianow
Created July 27, 2016 16:58
Show Gist options
  • Save dtinianow/e72cc41683115830ad8b9cd78985b13f to your computer and use it in GitHub Desktop.
Save dtinianow/e72cc41683115830ad8b9cd78985b13f to your computer and use it in GitHub Desktop.
  • What does it mean to concatenate files? Find an image of an example concatenated file. Why would we want to concatenate files?

Take contents from all files and puts them together in one file

  • What does it mean to precompile files? What does this have to do with coffeescript and sass files?

Takes abstractions of languages (ie SASS and Coffeescript) and preprocess them down into native languages (CSS & Javascript)

  • What does it mean to minify files? Find an image of an example minified file. Why would we want to minify files?

Eliminates whitespace and make a file as small as possible

On localhost you see all the code, in your assets you just see require statements for the outside libraries Once you are on localhost, all the code has been precompiled so now you can see these libraries

  • What is a manifest (in terms of the asset pipeline)? Where can you find two manifests in Catch 'em All?

file that will be compiled into application with all the files that listed/referenced in it you can find them in assets and the files are application.css and application.js

  • 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?

In app/views/layouts/application.html.erb we see this line: <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>

  • How is a digest/fingerprint used on the assets for caching purposes?

Fingerprint is unique based on the content of the file and will change if anything is different in the file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment