From 94f9cf488cb98788fb595a71fa922b419a120818 Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Thu, 19 Dec 2024 11:38:37 +0100 Subject: [PATCH] Make sure it adds the javascripts path to the assets path Fix https://github.com/basecamp/hotwire-spark/issues/16 --- lib/hotwire/spark/engine.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/hotwire/spark/engine.rb b/lib/hotwire/spark/engine.rb index 677c3a9e..40bd29c5 100644 --- a/lib/hotwire/spark/engine.rb +++ b/lib/hotwire/spark/engine.rb @@ -12,6 +12,10 @@ class Engine < ::Rails::Engine html_paths: %w[ app/controllers app/helpers app/models app/views ], stimulus_paths: %w[ app/javascript/controllers ] + initializer "hotwire_spark.assets" do |app| + app.config.assets.paths << root.join("app/assets/javascripts") + end + initializer "hotwire_spark.config" do |app| config.hotwire.spark.each do |key, value| Hotwire::Spark.send("#{key}=", value)