diff options
author | Ryan Bigg <radarlistener@gmail.com> | 2011-06-28 08:15:04 +1000 |
---|---|---|
committer | Ryan Bigg <radarlistener@gmail.com> | 2011-06-28 08:15:04 +1000 |
commit | 87a709846ec4bc1c3a101a7eec5e76d8b3db9c85 (patch) | |
tree | 782a533d8372b291ed7834df5debc0a81284dde7 /railties/guides/source/asset_pipeline.textile | |
parent | fb7ea76c1b44dc8c642b2bbedf83691d4cc0c387 (diff) | |
download | rails-87a709846ec4bc1c3a101a7eec5e76d8b3db9c85.tar.gz rails-87a709846ec4bc1c3a101a7eec5e76d8b3db9c85.tar.bz2 rails-87a709846ec4bc1c3a101a7eec5e76d8b3db9c85.zip |
[asset pipeline] sections at the bottom of the asset pipeline guide should all be toplevel
Diffstat (limited to 'railties/guides/source/asset_pipeline.textile')
-rw-r--r-- | railties/guides/source/asset_pipeline.textile | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/railties/guides/source/asset_pipeline.textile b/railties/guides/source/asset_pipeline.textile index f6e28a20c8..1fc422426a 100644 --- a/railties/guides/source/asset_pipeline.textile +++ b/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/projects.js.erb.coffee+ 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":https://github.com/lautis/uglifier gem. This gem wraps "UglifierJS":https://github.com/mishoo/UglifyJS (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":http://en.wikipedia.org/wiki/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 Tilt: https://github.com/rtomayko/tilt |