[openstreetmap/openstreetmap-website] Make AssetHelper work without precompiled assets (PR #6856)

Marwin Hochfelsner notifications at github.com
Wed Mar 4 13:07:24 UTC 2026


@hlfan commented on this pull request.



> @@ -2,8 +2,20 @@
 
 module AssetHelper
   def assets(directory)
-    Rails.application.assets_manifest.assets.keys.each_with_object({}) do |asset, assets|
-      assets[asset] = asset_path(asset) if asset.start_with?("#{directory}/")
+    if (manifest = Rails.application.assets_manifest.assets) && !manifest.empty?
+      # With precompiled assets
+      manifest.keys.each_with_object({}) do |asset, assets|
+        assets[asset] = asset_path(asset) if asset.start_with?("#{directory}/")
+      end
+    elsif (env = Rails.application.assets) && env.present?

If I interpreted it correctly, the env should not be available in a production setup.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6856#discussion_r2883697845
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/6856/review/3889326257 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260304/bb4d7855/attachment.htm>


More information about the rails-dev mailing list