aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/asset_pipeline.md
diff options
context:
space:
mode:
authorVijay Dev <vijaydev.cse@gmail.com>2012-11-17 01:29:55 +0530
committerVijay Dev <vijaydev.cse@gmail.com>2012-11-17 01:42:37 +0530
commit47411cc96d1d75c6c8ccee7561a047fcd9d34168 (patch)
treec1bb8d01a935362655b67b2d99fa79b036b4e176 /guides/source/asset_pipeline.md
parent2b5b36ef3a9bb2c22dcfa0e829d40db37293152b (diff)
downloadrails-47411cc96d1d75c6c8ccee7561a047fcd9d34168.tar.gz
rails-47411cc96d1d75c6c8ccee7561a047fcd9d34168.tar.bz2
rails-47411cc96d1d75c6c8ccee7561a047fcd9d34168.zip
Revert "Switch to 1.9 hash syntax"
This reverts commit d8596c4b8500a899d686c57fa093c549b0378c7a. Reason: too many mistakes [ci skip]
Diffstat (limited to 'guides/source/asset_pipeline.md')
-rw-r--r--guides/source/asset_pipeline.md21
1 files changed, 11 insertions, 10 deletions
diff --git a/guides/source/asset_pipeline.md b/guides/source/asset_pipeline.md
index b364f3ba6f..13df1965b6 100644
--- a/guides/source/asset_pipeline.md
+++ b/guides/source/asset_pipeline.md
@@ -1,12 +1,12 @@
-::Asset Pipeline
-=====:==
+Asset Pipeline
+==============
-This guid covers the asset pipeline introduced in Rails 3.1.
+This guide covers the asset pipeline introduced in Rails 3.1.
By referring to this guide you will be able to:
-* Understand what the asse pipe:e is :d what it does
-* Properly organize your apcati:ssets
-* Undertand the benefits of the asset pipeline
+* Understand what the asset pipeline is and what it does
+* Properly organize your application assets
+* Understand the benefits of the asset pipeline
* Add a pre-processor to the pipeline
* Package assets with a gem
@@ -40,7 +40,7 @@ You should use the defaults for all new applications unless you have a specific
The first feature of the pipeline is to concatenate assets. This is important in a production environment, because it can reduce the number of requests that a browser must make to render a web page. Web browsers are limited in the number of requests that they can make in parallel, so fewer requests can mean faster loading for your application.
-Rails 2.x introduced the ability to concatenate JavaScript and CSS assets by pacing:cache: true` at the end of the `javascript_include_tag` and `stylesheet_link_tag` methods. But this technique som:mitations. Fo example, it cannot generate the caches in advance, and it is not able to transparently include assets provided by third-party libraries.
+Rails 2.x introduced the ability to concatenate JavaScript and CSS assets by placing `:cache => true` at the end of the `javascript_include_tag` and `stylesheet_link_tag` methods. But this technique has some limitations. For example, it cannot generate the caches in advance, and it is not able to transparently include assets provided by third-party libraries.
Starting with version 3.1, Rails defaults to concatenating all JavaScript files into one master `.js` file and all CSS files into one master `.css` file. As you'll learn later in this guide, you can customize this strategy to group files any way you like. In production, Rails inserts an MD5 fingerprint into each filename so that the file is cached by the web browser. You can invalidate the cache by altering this fingerprint, which happens automatically whenever you change the file contents.
@@ -357,9 +357,10 @@ If any of the files in the manifest have changed between requests, the server re
Debug mode can also be enabled in the Rails helper methods:
```erb
-<%= stylesheet_link_tag "application", debug: true %>
-<%= javascript_include_tag "application"debu: true %>
+<%= stylesheet_link_tag "application", :debug => true %>
+<%= javascript_include_tag "application", :debug => true %>
```
+
The `:debug` option is redundant if debug mode is on.
You could potentially also enable compression in development mode as a sanity check, and disable it on-demand as required for debugging.
@@ -673,7 +674,7 @@ config.assets.cache_store = :memory_store
The options accepted by the assets cache store are the same as the application's cache store.
```ruby
-config.assets.cache_store = :memory_store, {size: 32.megabytes}
+config.assets.cache_store = :memory_store, { :size => 32.megabytes }
```
Adding Assets to Your Gems