sikachu / sprockets-redirect

A Rack middleware for Rails >= 3.1.0 with asset pipeline and asset digest enabled. This middleware is used to redirect any request to static asset without a digest to the version with digest in its filename by reading the assets manifest file generated after you run `rake assets:precompile`
http://rubygems.org/gems/sprockets-redirect
MIT License
72 stars 26 forks source link

redirect to asset host instead of request host #8

Closed AlexandreBernard closed 9 years ago

AlexandreBernard commented 10 years ago

I would need to redirect to my CDN url configured in production.rb

config.action_controller.asset_host = "http://static.xxx.com"

i see in the code that it only takes the requested url.

couldn't we add an option to use asset_host instead?

ianyamey commented 10 years ago

Pull request #6 adds support for redirecting to the asset host.

@sikachu hasn't merged it yet, but you can use my fork in your Gemfile:

gem 'sprockets-redirect', '~> 0.2.0', github: 'ianyamey/sprockets-redirect'

sikachu commented 9 years ago

6 just merged in. I'll release 0.2.1

sikachu commented 9 years ago

Correction — I've released 0.3.0 which include #6 in it.