diff --git a/app/controllers/tables_controller.rb b/app/controllers/tables_controller.rb index 15391309..92c3b3ff 100644 --- a/app/controllers/tables_controller.rb +++ b/app/controllers/tables_controller.rb @@ -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 diff --git a/app/views/layouts/_flashmessages.html.haml b/app/views/layouts/_flashmessages.html.haml index d273f3fd..3b4dd045 100644 --- a/app/views/layouts/_flashmessages.html.haml +++ b/app/views/layouts/_flashmessages.html.haml @@ -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