Forum: Ruby on Rails Form fields and MySQL column name Association

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
James E. (Guest)
on 2006-03-07 07:02
Im having trouble with a sports site im creating for a client of mine.
The part is where the Team Captians for each team in the league go into
the admin section to submit a match report for each match. The form
looks like this:

TEAM 1 BATTING: (these are all drop down menus that pull the player
names from the database)
There are 10 of these rows that look like this, 1 row for each player.
|-Batter-| |-Balls-| |-Minutes-| |-How Out-| |-Fielder-| |-Pitcher-| |-Runs-|

After they fill out this form, it has to submit all 10 rows into a
database table. The thing is, the column names in the table dont
associate with the form names...

I've tried something like:

@params = params[:playerclubseason]
@playermatchdata = Playermatchdata.new
@playermatchdata.PlayerID = @params[:HBTbatsman1]
@params = params[:playerclubseason]
etc...

But i keep getting nil for HBTbatsman, even though there is a value.

Is their anyway else to go about getting form fields to insert into
database columns with different names?

Any Help is much appreciated!
This topic is locked and can not be replied to.