diff options
author | Richard Schneeman <richard.schneeman@gmail.com> | 2016-08-31 10:28:31 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-31 10:28:31 -0500 |
commit | 4ba40bc2d6c31c1f5c38fe079cc6aaa2ef7ffa33 (patch) | |
tree | 8dd514d8e0e740df19c5a37e6684ccbc279be06a /guides | |
parent | eabfce4d600a3bdb1395a636f868f1ef08463486 (diff) | |
parent | 70dd041f354dfc71b7e516d5ba5725c769ef06d9 (diff) | |
download | rails-4ba40bc2d6c31c1f5c38fe079cc6aaa2ef7ffa33.tar.gz rails-4ba40bc2d6c31c1f5c38fe079cc6aaa2ef7ffa33.tar.bz2 rails-4ba40bc2d6c31c1f5c38fe079cc6aaa2ef7ffa33.zip |
Merge pull request #26226 from schneems/schneems/explicit-public-urls
Make public asset use explicit
Diffstat (limited to 'guides')
-rw-r--r-- | guides/source/asset_pipeline.md | 13 | ||||
-rw-r--r-- | guides/source/configuring.md | 2 |
2 files changed, 15 insertions, 0 deletions
diff --git a/guides/source/asset_pipeline.md b/guides/source/asset_pipeline.md index 701304acde..41dfeea84d 100644 --- a/guides/source/asset_pipeline.md +++ b/guides/source/asset_pipeline.md @@ -586,6 +586,19 @@ in your application are included in the `config.assets.precompile` list. If `config.assets.digest` is also true, the asset pipeline will require that all requests for assets include digests. +### Raise an Error When an Asset is Not Found + +If you are using sprockets-rails >= 3.2.0 you can configure what happens +when an asset lookup is performed and nothing is found. If you turn off "asset fallback" +then an error will be raised when an asset cannot be found. + +```ruby +config.assets.unknown_asset_fallback = false +``` + +If "asset fallback" is enabled then when an asset cannot be found the path will be +output instead and no error raised. The asset fallback behavior is enabled by default. + ### Turning Digests Off You can turn off digests by updating `config/environments/development.rb` to diff --git a/guides/source/configuring.md b/guides/source/configuring.md index c938edd8f7..a115683134 100644 --- a/guides/source/configuring.md +++ b/guides/source/configuring.md @@ -169,6 +169,8 @@ pipeline is enabled. It is set to `true` by default. * `config.assets.precompile` allows you to specify additional assets (other than `application.css` and `application.js`) which are to be precompiled when `rake assets:precompile` is run. +* `config.assets.unknown_asset_fallback` allows you to modify the behavior of the asset pipeline when an asset is not in the pipeline, if you use sprockets-rails 3.2.0 or newer. Defaults to `true`. + * `config.assets.prefix` defines the prefix where assets are served from. Defaults to `/assets`. * `config.assets.manifest` defines the full path to be used for the asset precompiler's manifest file. Defaults to a file named `manifest-<random>.json` in the `config.assets.prefix` directory within the public folder. |