aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/asset_paths.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_view/asset_paths.rb')
-rw-r--r--actionpack/lib/action_view/asset_paths.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/actionpack/lib/action_view/asset_paths.rb b/actionpack/lib/action_view/asset_paths.rb
index 75164b8134..cf30ad7e57 100644
--- a/actionpack/lib/action_view/asset_paths.rb
+++ b/actionpack/lib/action_view/asset_paths.rb
@@ -21,14 +21,15 @@ module ActionView
# When :relative (default), the protocol will be determined by the client using current protocol
# When :request, the protocol will be the request protocol
# Otherwise, the protocol is used (E.g. :http, :https, etc)
- def compute_public_path(source, dir, ext = nil, include_host = true, protocol = nil)
+ def compute_public_path(source, dir, options = {})
source = source.to_s
return source if is_uri?(source)
- source = rewrite_extension(source, dir, ext) if ext
- source = rewrite_asset_path(source, dir)
+ options[:include_host] ||= true
+ source = rewrite_extension(source, dir, options[:ext]) if options[:ext]
+ source = rewrite_asset_path(source, dir, options)
source = rewrite_relative_url_root(source, relative_url_root)
- source = rewrite_host_and_protocol(source, protocol) if include_host
+ source = rewrite_host_and_protocol(source, options[:protocol]) if options[:include_host]
source
end