diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 09705d1..a1e11f8 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,2 +1,5 @@ class ApplicationController < ActionController::Base + private + + def flash_stream = turbo_stream.replace(:notification, partial: 'layouts/notification') end diff --git a/app/controllers/flash_controller.rb b/app/controllers/flash_controller.rb index 4b22223..1624eaa 100644 --- a/app/controllers/flash_controller.rb +++ b/app/controllers/flash_controller.rb @@ -5,7 +5,7 @@ class FlashController < ApplicationController def turbo_notice flash[:notice] = 'From Turbo' flash[:alert] = 'Alert Turbo' - render turbo_stream: turbo_stream.replace(:notification, partial: 'layouts/notification') + render turbo_stream: flash_stream end def redirect_with_notice