diff options
author | Grzegorz Witek <arnvald.to@gmail.com> | 2015-11-08 21:39:39 +0800 |
---|---|---|
committer | Grzegorz Witek <arnvald.to@gmail.com> | 2015-11-08 21:39:39 +0800 |
commit | 6b77df0ade304e3856c8c07c93e2a8cde3c040f0 (patch) | |
tree | 21abd9459e96589621dcdb28b144e43f0b6c3eed /actionview/lib/action_view | |
parent | 25673f47b607528d12b0f4d1bace30b2c41a97fa (diff) | |
download | rails-6b77df0ade304e3856c8c07c93e2a8cde3c040f0.tar.gz rails-6b77df0ade304e3856c8c07c93e2a8cde3c040f0.tar.bz2 rails-6b77df0ade304e3856c8c07c93e2a8cde3c040f0.zip |
Allow `host` option in javscript and css helpers
Now both `javascript_include_tag` and `stylesheet_tag` can accept `host` option
to provide custom host for the asset
Diffstat (limited to 'actionview/lib/action_view')
-rw-r--r-- | actionview/lib/action_view/helpers/asset_tag_helper.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/actionview/lib/action_view/helpers/asset_tag_helper.rb b/actionview/lib/action_view/helpers/asset_tag_helper.rb index fa46a22500..2ffed6b395 100644 --- a/actionview/lib/action_view/helpers/asset_tag_helper.rb +++ b/actionview/lib/action_view/helpers/asset_tag_helper.rb @@ -55,7 +55,7 @@ module ActionView # # => <script src="http://www.example.com/xmlhr.js"></script> def javascript_include_tag(*sources) options = sources.extract_options!.stringify_keys - path_options = options.extract!('protocol', 'extname').symbolize_keys + path_options = options.extract!('protocol', 'extname', 'host').symbolize_keys sources.uniq.map { |source| tag_options = { "src" => path_to_javascript(source, path_options) @@ -91,7 +91,7 @@ module ActionView # # <link href="/css/stylish.css" media="screen" rel="stylesheet" /> def stylesheet_link_tag(*sources) options = sources.extract_options!.stringify_keys - path_options = options.extract!('protocol').symbolize_keys + path_options = options.extract!('protocol', 'host').symbolize_keys sources.uniq.map { |source| tag_options = { |