Hey there,

I wanted to set the asset host in my Rails project to point to my CDN. The 
CDN is pointing directly to the assets directory so that I didn't have to 
deal with duplicative content being found via crawlers if they crawl my 
CDN's domain and I had pointed it to the root of my site. The problem is if 
I set my asset_prefix to '' it'll cause the files to be stored via 
sprockets so they are referenced without the assets directory but I wanted 
to have them still in the assets directory so the origin can reference that.

I was able to get things working by hacking in a change to sprocket-rails 
asset helper to not use the asset prefix but it's still there for the 
purposes of pre compilation so the assets folder can be pointed to by my 
CDN.

Is there some other way to go about accomplishing this without needing to 
hack the asset helper logic? Wondering how others have dealt with this 
issue themselves. Alternatively I guess I could have uploaded my assets to 
s3 and use my CDN pointing to that and then I wouldn't need to worry about 
the root of my site being accessible it was just easier to avoid s3 
completely by forcing sprocket-rails to just not append that prefix when 
generating the asset paths.

Thanks,

Tim

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/ddc9ba28-2349-4dff-a0d7-4dc4e8a34b9b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to