From d6c58efe0c63c3c0f5d25f06e547303bef393a9c Mon Sep 17 00:00:00 2001 From: "Jesse C. Fisher" Date: Sun, 20 Oct 2019 21:59:40 -0700 Subject: [PATCH] Toying with Play Now --- app/controllers/games_controller.rb | 6 +++--- app/views/tables/show.html.haml | 15 --------------- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index bd1f7391..257ad6f3 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -106,9 +106,9 @@ class GamesController < ApplicationController def play_now # First joinable game or create new game @game = Game.play_now(current_user) - @seats = @game.seats.order(:position).map {|s| s.occupied? ? nil : s} + @seats = @game.table.seats.order(:position).map {|s| s.occupied? ? nil : s} @seats.compact.last.sit(current_user) - redirect_to @game + redirect_to @game.table end def join @@ -129,7 +129,7 @@ class GamesController < ApplicationController end flash[:notice] = 'Game started.' - redirect_to(@game) + redirect_to(@game.table) end def my_inventory diff --git a/app/views/tables/show.html.haml b/app/views/tables/show.html.haml index 39ad4bb4..91dda68f 100644 --- a/app/views/tables/show.html.haml +++ b/app/views/tables/show.html.haml @@ -57,20 +57,6 @@ - else %h1 Open table - -# .controls - - if @game.controlling_player.soft_token == current_user.soft_token - // Play hand form - = form_for @game, :url => play_hand_game_path(@game), remote: true do |f| - // Provide id of current game - -#= f.hidden_field :id - = f.submit "Play Hand" - = form_for @game, :url => play_hand_game_path(@game) do |f| - // Provide id of current game - -#= f.hidden_field :id - = f.hidden_field :hand_type, value: 'pass' - = f.submit "Pass" - - #game-component %h1= @game.title @@ -79,4 +65,3 @@ = render "seat", seat: @seats[0] #mid = render "seat", seat: @seats[1] -