Skip to content

Commit

Permalink
Removed the fetch method that was previously called on flash[:errors]…
Browse files Browse the repository at this point in the history
… in the index view
  • Loading branch information
lisahamm committed Feb 26, 2015
1 parent 1e93c0e commit 22bc581
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion tic_tac_toe_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class TicTacToeController < Sinatra::Base
@setup = GameSetup.new(params)
if @setup.invalid?
flash[:errors] = @setup.errors
p flash[:errors]
erb :index
else
session[:mark] = params[:player_mark]
Expand Down
6 changes: 3 additions & 3 deletions views/index.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<% if flash[:errors] %>
<div class="error">
<p>*<%= flash[:errors].fetch(:player_mark) %></p>
<p><%= flash[:errors][:player_mark] %></p>
</div>
<% end %>

Expand All @@ -21,7 +21,7 @@

<% if flash[:errors] %>
<div class="error">
<p>*<%= flash[:errors].fetch(:opponent) %></p>
<p><%= flash[:errors][:opponent] %></p>
</div>
<% end %>

Expand All @@ -33,7 +33,7 @@

<% if flash[:errors] %>
<div class="error">
<p>*<%= flash[:errors].fetch(:player_order) %></p>
<p><%= flash[:errors][:player_order] %></p>
</div>
<% end %>

Expand Down

0 comments on commit 22bc581

Please sign in to comment.