From 55dd66d2e02795c2ccf47ade30add940462a18d5 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Mon, 17 Nov 2025 03:13:12 +0900 Subject: [PATCH] Install assets if debug mode is enabled Now asset files are installed only in development environment. Therefore, the debug mode cannot be used in production environment. This change makes it possible to install asset files when the debug mode is enabled, regardless of the environment. ref: https://github.com/marcoroth/reactionview/issues/61 --- lib/reactionview/railtie.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/reactionview/railtie.rb b/lib/reactionview/railtie.rb index 6265b73..fd0511a 100644 --- a/lib/reactionview/railtie.rb +++ b/lib/reactionview/railtie.rb @@ -14,8 +14,8 @@ class Railtie < Rails::Railtie reactionview-dev-tools.umd.js ].freeze - initializer "reactionview.assets" do |app| - if ReActionView.config.development? && app.config.respond_to?(:assets) + initializer "reactionview.assets", after: :load_config_initializers do |app| + if ReActionView.config.debug_mode_enabled? && app.config.respond_to?(:assets) gem_root = Gem::Specification.find_by_name("reactionview").gem_dir app.config.assets.paths << File.join(gem_root, "app", "assets", "javascripts")