From a93ce4ea5525f5809c3d8409e7ceb5e52c175ae0 Mon Sep 17 00:00:00 2001 From: Ahmed Ejaz Date: Wed, 29 May 2024 01:20:10 +0500 Subject: [PATCH] 12398: append flash in the flashes container --- .../products_v3/destroy_product_variant.turbo_stream.haml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/views/admin/products_v3/destroy_product_variant.turbo_stream.haml b/app/views/admin/products_v3/destroy_product_variant.turbo_stream.haml index 6ea1bc1a8f..645b265c41 100644 --- a/app/views/admin/products_v3/destroy_product_variant.turbo_stream.haml +++ b/app/views/admin/products_v3/destroy_product_variant.turbo_stream.haml @@ -1,6 +1,5 @@ - # @record can either be Product or Variant - unless flash[:error] = turbo_stream.remove(dom_id(@record)) --# Without +formats+ option here, by default render is trying to render the equivalant turbo stream --# It's strange that it works just fine if I remove the +unless+ above -= render(partial: 'admin/shared/flashes', locals: { flashes: flash }, formats: [:html]) += turbo_stream.append "flashes" do + = render(partial: 'admin/shared/flashes', locals: { flashes: flash })