Browse Source

refactor

main
pvincent 5 months ago
parent
commit
a5f5f3f017
  1. 10
      app/controllers/flash_controller.rb

10
app/controllers/flash_controller.rb

@ -1,6 +1,8 @@
# interaction with the flash message
class FlashController < ApplicationController
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
flash[:notice] = 'From Turbo'
@ -8,14 +10,6 @@ class FlashController < ApplicationController
render turbo_stream: flash_stream
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
def build_message(type_of_message)

Loading…
Cancel
Save