diff --git a/app/assets/stylesheets/tailwind/main.tailwind.css b/app/assets/stylesheets/tailwind/main.tailwind.css index 8518303..0ae0423 100644 --- a/app/assets/stylesheets/tailwind/main.tailwind.css +++ b/app/assets/stylesheets/tailwind/main.tailwind.css @@ -14,5 +14,5 @@ h5 { @apply text-xl} h6 { @apply text-base } .title { @apply bg-gradient-to-r from-color-primary to-color-secondary text-yellow-400 sm:rounded-t-lg; } -.button { @apply bg-slate-200 hover:bg-slate-500 cursor-pointer } +.button { @apply bg-slate-200 hover:bg-slate-400 px-1 cursor-pointer } .menu { @apply text-slate-200 hover:bg-slate-700 p-2 text-2xl} \ No newline at end of file diff --git a/app/controllers/flash_controller.rb b/app/controllers/flash_controller.rb index 9cbe6cc..9f309f8 100644 --- a/app/controllers/flash_controller.rb +++ b/app/controllers/flash_controller.rb @@ -1,8 +1,15 @@ # 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 redirect_with_notice = redirect_to(flash_path, notice:) + def redirect_with_alert = redirect_to(flash_path, alert:) + + def render_notice + flash[:notice] = 'From Render' + flash[:alert] = 'Alert Render' + render :index + end def turbo_notice flash[:notice] = 'From Turbo' @@ -12,6 +19,9 @@ class FlashController < ApplicationController private + def notice = build_message(:notice) + def alert = build_message(:alert) + def build_message(type_of_message) session[:flash_iteration] = session[:flash_iteration].to_i + 1 "this is #{type_of_message} ##{session[:flash_iteration]}" diff --git a/app/views/flash/index.html.erb b/app/views/flash/index.html.erb index 1b3a07c..8c2e3bc 100644 --- a/app/views/flash/index.html.erb +++ b/app/views/flash/index.html.erb @@ -7,9 +7,10 @@