]> git.openstreetmap.org Git - rails.git/blobdiff - app/helpers/asset_helper.rb
Merge pull request #3700 from AntonKhorev/about
[rails.git] / app / helpers / asset_helper.rb
index 67c1a141d7d79a22a38b99979bca6088763e5e0e..40782fbcfad5676e6c59eb900610aef25d27ab22 100644 (file)
@@ -1,11 +1,7 @@
 module AssetHelper
   def assets(directory)
 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
     end
-
-    assets
   end
 end
   end
 end