From 6881f6c453b9678ab2ff015f633af7bedeca8a7e Mon Sep 17 00:00:00 2001
From: Thomas von Deyen <thomas@vondeyen.com>
Date: Mon, 18 Nov 2019 11:24:13 +0100
Subject: [PATCH] Disable ActionView partial path prefixing

If you want to render alchemy elements in a Solidus controller
namespace, we need to disable prefixing of controller path to partial
paths, or we get an extra `spree` namespace for the element partial
paths and the elements wont render.

Closes https://github.com/AlchemyCMS/alchemy_cms/issues/1626
---
 lib/alchemy/solidus/alchemy_in_solidus.rb | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/alchemy/solidus/alchemy_in_solidus.rb b/lib/alchemy/solidus/alchemy_in_solidus.rb
index 95fa62c..61a9947 100644
--- a/lib/alchemy/solidus/alchemy_in_solidus.rb
+++ b/lib/alchemy/solidus/alchemy_in_solidus.rb
@@ -12,3 +12,7 @@
 Spree::BaseController.send :include, Alchemy::ControllerActions
 Spree::UserSessionsController.send :include, Alchemy::ControllerActions if defined? Spree::UserSessionsController
 Spree::BaseController.send :include, Alchemy::ConfigurationMethods
+
+# Do not prefix element view partials with `spree` namespace.
+# See https://github.com/AlchemyCMS/alchemy_cms/issues/1626
+ActionView::Base.prefix_partial_path_with_controller_namespace = false