diff options
Diffstat (limited to 'actionpack/lib/action_view/asset_paths.rb')
-rw-r--r-- | actionpack/lib/action_view/asset_paths.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/actionpack/lib/action_view/asset_paths.rb b/actionpack/lib/action_view/asset_paths.rb index 73f4f8ee5f..75164b8134 100644 --- a/actionpack/lib/action_view/asset_paths.rb +++ b/actionpack/lib/action_view/asset_paths.rb @@ -27,7 +27,7 @@ module ActionView source = rewrite_extension(source, dir, ext) if ext source = rewrite_asset_path(source, dir) - source = rewrite_relative_url_root(source, relative_url_root) if has_request? + source = rewrite_relative_url_root(source, relative_url_root) source = rewrite_host_and_protocol(source, protocol) if include_host source end @@ -119,10 +119,11 @@ module ActionView end def relative_url_root - config = controller.config if controller.respond_to?(:config) - config ||= config.action_controller if config.action_controller.present? - config ||= config - config.relative_url_root + if config.action_controller.present? + config.action_controller.relative_url_root + else + config.relative_url_root + end end def asset_host_config |