How can I configure rails to serve assets on different subdomain? I basically want view/assets helpers to use subdomain for all static files, such as;
do you know about the asset_host
option?
# config/environments/production.rb
config.action_controller.asset_host = "static.example.com"
it's also possible to do dynamic names:
ActionController::Base.asset_host = Proc.new { |source|
"http://assets#{Digest::MD5.hexdigest(source).to_i(16) % 2 + 1}.example.com"
}
http://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html