diff options
Diffstat (limited to 'actionpack/lib/action_view/asset_paths.rb')
-rw-r--r-- | actionpack/lib/action_view/asset_paths.rb | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/actionpack/lib/action_view/asset_paths.rb b/actionpack/lib/action_view/asset_paths.rb index cf30ad7e57..1d16e34df6 100644 --- a/actionpack/lib/action_view/asset_paths.rb +++ b/actionpack/lib/action_view/asset_paths.rb @@ -16,8 +16,6 @@ module ActionView # roots. Rewrite the asset path for cache-busting asset ids. Include # asset host, if configured, with the correct request protocol. # - # When include_host is true and the asset host does not specify the protocol - # the protocol parameter specifies how the protocol will be added. # 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) @@ -25,11 +23,10 @@ module ActionView source = source.to_s return source if is_uri?(source) - 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, options[:protocol]) if options[:include_host] + source = rewrite_host_and_protocol(source, options[:protocol]) source end @@ -89,9 +86,7 @@ module ActionView end def default_protocol - protocol = @config.action_controller.default_asset_host_protocol if @config.action_controller.present? - protocol ||= @config.default_asset_host_protocol - protocol || (has_request? ? :request : :relative) + @config.default_asset_host_protocol || (has_request? ? :request : :relative) end def invalid_asset_host!(help_message) @@ -120,19 +115,11 @@ module ActionView end def relative_url_root - if config.action_controller.present? - config.action_controller.relative_url_root - else - config.relative_url_root - end + config.relative_url_root end def asset_host_config - if config.action_controller.present? - config.action_controller.asset_host - else - config.asset_host - end + config.asset_host end # Returns the current request if one exists. |