In my RoR I have a table games, stats, and players. Each game has many players, each player has many ‘stats,’ and each games has many stats through players. What i want to be able to do is in on my edit games form, i want there to be a a row of fields to add a new stat row, one per each players the game has. Ive been reading a lot about nested_attributes, but found new good resources how to fully do this.
In my RoR I have a table games , stats , and players .
Share
UPDATE: Here’s an updated set of classes based on the new associations you’ve stated in your comment
Note this doesn’t do any sort of ajax “add another stat” or anything fancy. It just sticks one extra blank field at the end for each player. If you needed more, you could build more blank stat objects in the
GamesController#editaction or implement some fancy pants javascript. Hopefully that will get you close enough to be able to get your real data working.