![]() |
Ruby on Rails Question
I hope I put this in the right place =/. Anyway I'm having trouble figuring out how to do something. I know this is a really HORRIBLE design but it's what the professor wants, so I guess I have to follow that model.
Ok, so I'm working on an assignment right now and I've got a model that represents a football team. It has a name field, which has the name of the football team, and it has a single player field, which looks up values from my player model for the user to select. I want to be able to add another player field - as many as I need to in order to fill the team with the amount of players the user wants to have. What It Looks Like: Name: [Text Field] Player: [Drop-Down Box] [Create Team Button] What I want, essentially: Name: [Text Field] Player: [Drop-Down Box] Player1: [Drop-Down Box] Player2: [Drop-Down Box] [Add Player Button] [Create Button] ---------------------------------------- I basically need to add more fields to my database schema from the view. It doesn't need to have perfect formatting (ideally I'd have better names for player, player1, player2, etc) I'm also not sure how to add in a blank value to the player list. Not all teams are going to have the same amount of players (eleven at bare minimum) and since I'm changing the schema that ALL teams must follow, one team might have 26 players, and another might just have 15, so some player fields need the option of having a null value for a player field. ----------------------------------------- I am COMPLETELY stumped on this :(. |
All times are GMT -5. The time now is 04:25 PM. |
Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2025, vBulletin Solutions, Inc.