Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions lib/sprockets/rails/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,17 @@ def compute_asset_path(path, options = {})
File.join(assets_prefix || "/", legacy_debug_path(asset_path, debug))
else
message = "The asset #{ path.inspect } is not present in the asset pipeline."
raise AssetNotFound, message unless unknown_asset_fallback

unless unknown_asset_fallback
message << "\nThe following asset resolver strategies were used: "
message << (asset_resolver_strategies.join(', ').presence ||
'none (refer to: `config.assets.resolve_with` on https://github.com/rails/sprockets-rails)')

raise AssetNotFound, message
end

if respond_to?(:public_compute_asset_path)
message << "Falling back to an asset that may be in the public folder.\n"
message << "\nFalling back to an asset that may be in the public folder.\n"
message << "This behavior is deprecated and will be removed.\n"
message << "To bypass the asset pipeline and preserve this behavior,\n"
message << "use the `skip_pipeline: true` option.\n"
Expand Down