Add bot actions to flash messages

This commit is contained in:
Jesse C. Fisher 2025-04-20 18:19:36 -07:00 committed by icwizardmonke
parent 381f67f93b
commit 825d22e827
2 changed files with 8 additions and 2 deletions

View File

@ -35,7 +35,13 @@ class TablesController < ApplicationController
# TODO refactor to ensure play for 2nd and 3rd place
if @game.controlling_player.try("is_bot?")
@game.controlling_player.auto_play
bot_action = @game.controlling_player.auto_play
flash[:notice] ||= ""
if bot_action == "pass" # TODO bot passes notify
flash[:notice] << " #{@game.controlling_player.display_name} passed."
else
flash[:notice] << " #{@game.controlling_player.display_name} played #{bot_action}"
end
@game.save
@game.reload
end

View File

@ -1,4 +1,4 @@
.original_flash_message_code
.original_flash_message_code#flash_message
- flash.each do |key, value|
%div{class: "alert alert-#{key}"}
= value