I want Rails 3 to dynamically grab assets depending on current domain:
mysite.com - assets.mysite.com mysite.ru - assets.mysite.ru
Is it possible out of the box? Or I should implement it manually?
I want Rails 3 to dynamically grab assets depending on current domain:
mysite.com - assets.mysite.com mysite.ru - assets.mysite.ru
Is it possible out of the box? Or I should implement it manually?
Are you meaning subdomains?
subdomains(tld_length = 1)
Returns all the subdomains as an array, so ["dev", "www"] would be returned for “dev.www.rubyonrails.org“. You can specify a different tld_length, such as 2 to catch ["www"] instead of ["www", "rubyonrails"] in “www.rubyonrails.co.uk“.
In config/environments/production.rb etc.
config.action_controller.asset_host = "http://assets." << request.host