Skip to content

Commit

Permalink
[asset pipeline] Add production assets section
Browse files Browse the repository at this point in the history
  • Loading branch information
radar committed Jun 27, 2011
1 parent 9959fa2 commit 6a1803a
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion railties/guides/source/asset_pipeline.textile
Expand Up @@ -95,7 +95,18 @@ 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.

h3. Compressing Assets
h3. Production Assets

In the production environment, assets are served slightly differently to how they are served in the development environment.

TODO: Talk here about:
* Rack::Cache's caching
* Sprocket's auto-generated MD5 hashes
* Sass-rails's handy +image_url+ helpers
* ERB pre-processing and +asset_url+


h4. 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.

Expand Down

0 comments on commit 6a1803a

Please sign in to comment.