diff --git a/flipped-demos/ch03-saas/sinatra-sessions/#app.rb# b/flipped-demos/ch03-saas/sinatra-sessions/#app.rb# deleted file mode 100644 index c204d4d..0000000 --- a/flipped-demos/ch03-saas/sinatra-sessions/#app.rb# +++ /dev/null @@ -1,12 +0,0 @@ -require 'sinatra' -class DemoApp < Sinatra::Base - enable :sessions - get '/' do - @someone = session[:thing] - erb :hello - end - get '/set/:something' do - session[:thing] = params[:something] - redirect '/' - end -end diff --git a/flipped-demos/ch03-saas/ttt/tic_tac_toe.rb b/flipped-demos/ch03-saas/ttt/tic_tac_toe.rb index ffeb190..b8e82df 100644 --- a/flipped-demos/ch03-saas/ttt/tic_tac_toe.rb +++ b/flipped-demos/ch03-saas/ttt/tic_tac_toe.rb @@ -25,8 +25,9 @@ def move(player,square) end def board_full - # ! @board.any?(&:empty?) ! @board.any? { |square| square.empty? } + # or more concise: + # ! @board.any?(&:empty?) end def over? diff --git a/flipped-demos/ch03-saas/ttt/views/game.erb b/flipped-demos/ch03-saas/ttt/views/game.erb index 202a492..aa8be54 100644 --- a/flipped-demos/ch03-saas/ttt/views/game.erb +++ b/flipped-demos/ch03-saas/ttt/views/game.erb @@ -1,54 +1,28 @@ - - - -
- - - - <% if session[:message] %> -- <% val = @game.board[i] %> - <% if val.empty? %> - <%= i %> - <% else %> - <%= val %> - <% end %> - <% i += 1 %> - | - <% end %> -