This commit is contained in:
pvincent
2024-07-10 02:12:50 +04:00
parent ef94b8b92b
commit a5f5f3f017
+2 -8
View File
@@ -1,6 +1,8 @@
# interaction with the flash message # interaction with the flash message
class FlashController < ApplicationController class FlashController < ApplicationController
def index; end def index; end
def redirect_with_notice = redirect_to flash_path, notice: build_message(:notice)
def redirect_with_alert = redirect_to flash_path, alert: build_message(:alert)
def turbo_notice def turbo_notice
flash[:notice] = 'From Turbo' flash[:notice] = 'From Turbo'
@@ -8,14 +10,6 @@ class FlashController < ApplicationController
render turbo_stream: flash_stream render turbo_stream: flash_stream
end end
def redirect_with_notice
redirect_to flash_path, notice: build_message(:notice)
end
def redirect_with_alert
redirect_to flash_path, alert: build_message(:alert)
end
private private
def build_message(type_of_message) def build_message(type_of_message)