Browse Source

flash stream

main
pvincent 6 months ago
parent
commit
3e4f535a46
  1. 3
      app/controllers/application_controller.rb
  2. 2
      app/controllers/flash_controller.rb

3
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

2
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

Loading…
Cancel
Save