aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/asset_pipeline.md
diff options
context:
space:
mode:
authorJon Atack <jonnyatack@gmail.com>2016-08-19 18:47:47 +0200
committerJon Atack <jonnyatack@gmail.com>2016-08-19 22:24:54 +0200
commitb4c92be4711cdaa5ba8f49bd46a7962c12d78633 (patch)
tree96fc47aaf9236b7f6acd137183cf11c51866e951 /guides/source/asset_pipeline.md
parent6107a40c0e4d05614493bddf33d5ae8d9ce8a8d2 (diff)
downloadrails-b4c92be4711cdaa5ba8f49bd46a7962c12d78633.tar.gz
rails-b4c92be4711cdaa5ba8f49bd46a7962c12d78633.tar.bz2
rails-b4c92be4711cdaa5ba8f49bd46a7962c12d78633.zip
Consistent examples and template for assets#precompile
Listening to a few developers today discussing their troubles in understanding how to use the asset pipeline, it turns out that the precompile examples in the guides and assets.rb template have over time become a bit inconsistent. This PR makes the examples consistent in code style, spacing, and asset names, removes the old 'swfObject.js' example, and in a couple of places wraps lines at 80 characters including in the assets.rb template. Re-add spaces inside array parentheses.
Diffstat (limited to 'guides/source/asset_pipeline.md')
-rw-r--r--guides/source/asset_pipeline.md10
1 files changed, 5 insertions, 5 deletions
diff --git a/guides/source/asset_pipeline.md b/guides/source/asset_pipeline.md
index e6631a513c..5c085002ce 100644
--- a/guides/source/asset_pipeline.md
+++ b/guides/source/asset_pipeline.md
@@ -724,7 +724,7 @@ If you have other manifests or individual stylesheets and JavaScript files to
include, you can add them to the `precompile` array in `config/initializers/assets.rb`:
```ruby
-Rails.application.config.assets.precompile += ['admin.js', 'admin.css', 'swfObject.js']
+Rails.application.config.assets.precompile += %w( admin.js admin.css )
```
NOTE. Always specify an expected compiled filename that ends with .js or .css,
@@ -1109,9 +1109,9 @@ Windows you have a JavaScript runtime installed in your operating system.
### Serving GZipped version of assets
-By default, gzipped version of compiled assets will be generated, along
-with the non-gzipped version of assets. Gzipped assets help reduce the transmission of
-data over the wire. You can configure this by setting the `gzip` flag.
+By default, gzipped version of compiled assets will be generated, along with
+the non-gzipped version of assets. Gzipped assets help reduce the transmission
+of data over the wire. You can configure this by setting the `gzip` flag.
```ruby
config.assets.gzip = false # disable gzipped assets generation
@@ -1291,7 +1291,7 @@ config.assets.digest = true
# Precompile additional assets (application.js, application.css, and all
# non-JS/CSS are already added)
-# config.assets.precompile += %w( search.js )
+# config.assets.precompile += %w( admin.js admin.css )
```
Rails 4 and above no longer set default config values for Sprockets in `test.rb`, so