Skip to content

Instantly share code, notes, and snippets.

@MikeSilvis
Created July 6, 2012 12:54
Show Gist options
  • Save MikeSilvis/3060016 to your computer and use it in GitHub Desktop.
Save MikeSilvis/3060016 to your computer and use it in GitHub Desktop.
def create
score1 = Score.new(:points => params[:score1], :player_id => params[:player1_id])
score2 = Score.new(:points => params[:score2], :player_id => params[:player2_id])
game = Game.new(params[:game], scores: [score1, score2])
redirect_to games_path, notice: "Game results recorded!" if game.save
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment