I've got a list of games, and users can guess the score of each game.
The guesses are appropriately sent to guesses_controller.rb, but I can't
get any of the validations in guess.rb to work. Here's what I have in
<form method="post" action="/guesses/create" >
<%= error_messages_for :guess %>
<% @games.each do |game| %>
<td><%= game.home_team.city %></td>
<td><input type="text" name="home_score_<%=game.id%>" size="1" /></td>
<td><input type="text" name="away_score_<%=game.id%>" size="1" /></td>
<td><%= game.away_team.city %></td>
<% end %>
<button type="submit" class="button positive">
Save your predictions
My model has this:
validates_numericality_of :home_score, :away_score
Is it because the guesses are called home_score_x and away_score_x?