Skip to content

Instantly share code, notes, and snippets.

@pindell-matt
Last active April 20, 2016 15:46
Show Gist options
  • Save pindell-matt/98a9cc47040ed7d147ff9d6f3ad7c353 to your computer and use it in GitHub Desktop.
Save pindell-matt/98a9cc47040ed7d147ff9d6f3ad7c353 to your computer and use it in GitHub Desktop.
  • Q: What does it mean to concatenate files? Find an image of an example concatenated file. Why would we want to concatenate files?

  • A: To consolidate multiple files into one, by appending the contents of each - doing so puts them all in one easily-accesible place.

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

  • A: To compile into an intermediate form that is faster for a compiler to process. Allows coffeescript and sass to provide heaps of synactic sugar to make your life easier - they also provide errors at build time as opposed to run time.

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

  • A: To remove whitespace / unecessary characters from a program - withouth changing it's functionality. It reduces the amount of data that needs to be transferred (making things faster) without changing what's happening.

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

  • A: Because it's showing the full contents of each of the requires: jquery, jquery_ujs, turbolinks, require_tree

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

  • A: A file that holds precompiled sections of code, and compiles into a full version when the program executes. 2 examples are application.js and application.css.css

  • Q: In regular HTML files, we bring in css files with . How is this done in a Rails project? Where do you see this line in Catch 'em All?

  • A: Line 5 of the application.html.erb file: <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>

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

  • A:

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