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)