Skip to content

Commit

Permalink
Adds notes on the :asset_host option to README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ianyamey authored and Prem Sichanugrist committed Dec 30, 2014
1 parent 0eaed9f commit be2a6a7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Expand Up @@ -35,7 +35,7 @@ Insert this line into your Gemfile:
Usage
-----

This middleware will be enabled by default if you set `config.assets.compile = false` and `config.assets.digest = true` in your configuration file. It will automatically retrieve your asset prefix and the list of your digests automatically from Rails.
This middleware will be enabled by default if you set `config.assets.compile = false` and `config.assets.digest = true` in your configuration file. It will automatically retrieve the asset prefix, asset host, and the list of your digests from Rails.

You could also config this middle ware at a class level, or at middleware initialization.

Expand Down Expand Up @@ -64,6 +64,7 @@ These configurations are configured via an option hash:
* `:digests` - Set a hash used for file name lookup. This will be default to Rails' manifest at `Rails.configuration.assets.digests`.
* `:prefix` - Set a path prefix of your assets file. This will be default to `Rails.configuration.assets.prefix` (usually at `/assets`.)
* `:manifest` - Set a path to your own manifest file to use for lookup. This will override both `:digest` hash and `Sprockets::Redirect.manifest` setting.
* `:asset_host` - Set the name of the host to use when serving assets. This is useful if you want your server to redirect to assets that are hosted on a CDN.

You can swap out the middleware inserted automatically by the gem by using `config.middleware.swap` in your configuration file:

Expand Down

0 comments on commit be2a6a7

Please sign in to comment.