diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2013-01-21 21:21:39 +0100 |
---|---|---|
committer | Piotr Sarnacki <drogus@gmail.com> | 2013-01-21 21:21:39 +0100 |
commit | 445f14e97553de552745de26ebd5e49bc5c82f4e (patch) | |
tree | f35bfb4e877a9d51d91d0c78e6ff725536f6badb /actionpack/lib/action_view/helpers | |
parent | 5984894fc9779ce625c9264d32d77581bd6c52ba (diff) | |
download | rails-445f14e97553de552745de26ebd5e49bc5c82f4e.tar.gz rails-445f14e97553de552745de26ebd5e49bc5c82f4e.tar.bz2 rails-445f14e97553de552745de26ebd5e49bc5c82f4e.zip |
Fix asset_path in mounted engine
Historically serving assets from a mountable engine could be achieved by
running ActionDispatch::Static as a part of engine middleware stack or
to copy assets prefixed with an engine name. After introduction of
assets pipeline this is not needed as all of the assets are served or
compiled into main application's assets.
This commit removes the obsolete line making asset_path always generate
paths relative to the root or config.relative_url_root if it's set.
(closes #8119)
Diffstat (limited to 'actionpack/lib/action_view/helpers')
-rw-r--r-- | actionpack/lib/action_view/helpers/asset_url_helper.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/helpers/asset_url_helper.rb b/actionpack/lib/action_view/helpers/asset_url_helper.rb index 0affac41e8..71b78cf0b5 100644 --- a/actionpack/lib/action_view/helpers/asset_url_helper.rb +++ b/actionpack/lib/action_view/helpers/asset_url_helper.rb @@ -132,8 +132,7 @@ module ActionView source = compute_asset_path(source, options) end - relative_url_root = (defined?(config.relative_url_root) && config.relative_url_root) || - (respond_to?(:request) && request.try(:script_name)) + relative_url_root = defined?(config.relative_url_root) && config.relative_url_root if relative_url_root source = "#{relative_url_root}#{source}" unless source.starts_with?("#{relative_url_root}/") end |