-
Notifications
You must be signed in to change notification settings - Fork 75
Open
Labels
Description
Hi! What do you think of support the folders "media/images"
as the webpacker helper image_pack_tag
does?
In the implementation of webpacker helpers, it has the following code:
def resolve_path_to_image(name)
path = name.starts_with?("media/images/") ? name : "media/images/#{name}"
asset_path(current_webpacker_instance.manifest.lookup!(path))
rescue
asset_path(current_webpacker_instance.manifest.lookup!(name))
end
Maybe we can do something similar with InlineSvg::WebpackAssetFinder
like this, or try to use the resolve_path_to_image
method of webpacker:
module InlineSvg
class WebpackAssetFinder
def self.find_asset(filename)
...
end
def initialize(filename)
@filename = filename.starts_with?('media/images/') ? filename : "media/images/#{filename}"
end
def pathname
...
end
end
end
janko