Browse files

[asset pipeline] sections at the bottom of the asset pipeline guide s…

…hould all be toplevel
  • Loading branch information...
1 parent fb7ea76 commit 87a709846ec4bc1c3a101a7eec5e76d8b3db9c85 @radar radar committed Jun 27, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 railties/guides/source/asset_pipeline.textile
@@ -94,17 +94,17 @@ In addition to this single layer of pre-processing, we can also put on additiona
Keep in mind that the order of these pre-processors is important. For example, if we called our JavaScript file +app/assets/javascripts/ then it would be processed with the CoffeeScript interpreter first, which wouldn't understand ERB and therefore we would run into problems.
-h4. Compressing Assets
+h3. Compressing Assets
The default Gemfile also includes the "uglifier": gem. This gem wraps "UglifierJS": (written for NodeJS) in Ruby. It compress your code by removing white spaces and other magical things like changing your if and else statements to ternary operators when possible.
Sprockets also creates a "Gzip": (.gz) of your assets. This prevents your server from contently compressing your assets for each request. You must configure your server to use GZip compression and serve the compressed assets in {location}. {Give Apache and NGINX examples since those are what's cool}
-h4. Adding Assets to Your Gems
+h3. Adding Assets to Your Gems
To include your assets inside of a gem, simple package it in +lib/assets+ as you would in +app/assets+. You should append or prepend the name of your gem though, this should help avoid name conflicts with other gems or the user's application.
-h4. Making Your Library or Gem a Pre-Processor
+h3. Making Your Library or Gem a Pre-Processor
"You should be able to register [your gems] on Tilt and Sprockets will find them." - Josh

0 comments on commit 87a7098

Please sign in to comment.