From 1f93bfb748b0c4a7a1d126bc45c63ade4056e0a7 Mon Sep 17 00:00:00 2001 From: Nathan Williams Date: Wed, 6 Nov 2019 16:31:05 -0800 Subject: [PATCH] fix issue #209 stores layouts not rendering with rails 6 --- lib/spree_multi_domain/engine.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/spree_multi_domain/engine.rb b/lib/spree_multi_domain/engine.rb index c3be52f9..0f77f4c1 100644 --- a/lib/spree_multi_domain/engine.rb +++ b/lib/spree_multi_domain/engine.rb @@ -20,6 +20,11 @@ def self.activate initializer "templates with dynamic layouts" do |app| ActionView::TemplateRenderer.prepend( Module.new do + def render(context, options) + @view = context + super(context, options) + end + def find_layout(layout, locals, formats=[]) store_layout = layout if @view.respond_to?(:current_store) && @view.current_store && !@view.controller.is_a?(Spree::Admin::BaseController) && !@view.controller.is_a?(Spree::Api::BaseController)