refactor
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user