]> git.openstreetmap.org Git - rails.git/blobdiff - app/helpers/asset_helper.rb
Merge branch 'pull/5297'
[rails.git] / app / helpers / asset_helper.rb
index 67c1a141d7d79a22a38b99979bca6088763e5e0e..40782fbcfad5676e6c59eb900610aef25d27ab22 100644 (file)
@@ -1,11 +1,7 @@
 module AssetHelper
   def assets(directory)
-    assets = {}
-
-    Rails.application.assets.index.each_logical_path("#{directory}/*") do |path|
-      assets[path.sub(/^#{directory}\//, "")] = asset_path(path)
+    Rails.application.assets_manifest.assets.keys.each_with_object({}) do |asset, assets|
+      assets[asset] = asset_path(asset) if asset.start_with?("#{directory}/")
     end
-
-    assets
   end
 end