aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/helpers
diff options
context:
space:
mode:
authorHubert Łępicki <hubert.lepicki@amberbit.com>2014-05-08 08:05:45 +0200
committerHubert Łępicki <hubert.lepicki@amberbit.com>2014-05-08 08:10:00 +0200
commit5371106d530e64cfb221492714fb7cef32fa45c3 (patch)
tree41d1fb3e1fabb6e502db5dddbbf9b0ead1a2e5d6 /actionview/lib/action_view/helpers
parentd2061a224d4e99cbc0f859c50f0c35277773369e (diff)
downloadrails-5371106d530e64cfb221492714fb7cef32fa45c3.tar.gz
rails-5371106d530e64cfb221492714fb7cef32fa45c3.tar.bz2
rails-5371106d530e64cfb221492714fb7cef32fa45c3.zip
Allow custom asset host to be passed in asset_url
Diffstat (limited to 'actionview/lib/action_view/helpers')
-rw-r--r--actionview/lib/action_view/helpers/asset_url_helper.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/actionview/lib/action_view/helpers/asset_url_helper.rb b/actionview/lib/action_view/helpers/asset_url_helper.rb
index 41997a85b3..86a84c1356 100644
--- a/actionview/lib/action_view/helpers/asset_url_helper.rb
+++ b/actionview/lib/action_view/helpers/asset_url_helper.rb
@@ -191,7 +191,8 @@ module ActionView
# (proc or otherwise).
def compute_asset_host(source = "", options = {})
request = self.request if respond_to?(:request)
- host = config.asset_host if defined? config.asset_host
+ host = options[:host]
+ host ||= config.asset_host if defined? config.asset_host
host ||= request.base_url if request && options[:protocol] == :request
if host.respond_to?(:call)