![]() |
||
|
|
Welcome to the Exploding Garrmondo Weiner Interactive Swiss Army Penis. |
GFF is a community of gaming and music enthusiasts. We have a team of dedicated moderators, constant member-organized activities, and plenty of custom features, including our unique journal system. If this is your first visit, be sure to check out the FAQ or our GFWiki. You will have to register before you can post. Membership is completely free (and gets rid of the pesky advertisement unit underneath this message).
|
![]() |
|
Thread Tools |
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 ![]() Jam it back in, in the dark. ![]() FGSFDS!!! |