D
Depili
I'm quite new to ruby and I'm learning with ruby on rails, but I have
hit a brick wall, because I want to parse several fields from a web
form which give the same data in a loop and maintaining the order from
the web form.
So I have a form with fields like:
Data[1][Name] Data[1]Notes .....
Data[2][Name] Data[2]Notes .....
and the params hash looks like
{"Data" = {"1" = {"Name" = "foo", "Notes"="bar"}, "2" = {.....
I can access the fields easily when the keynames are strings, but with
numbered keys params[ata][1] doesn't work. Also params[Data].each do
|data| leads to errors,,,
I would like to get a way of accessing the hashes inside data for
creating new database entries in rails.
hit a brick wall, because I want to parse several fields from a web
form which give the same data in a loop and maintaining the order from
the web form.
So I have a form with fields like:
Data[1][Name] Data[1]Notes .....
Data[2][Name] Data[2]Notes .....
and the params hash looks like
{"Data" = {"1" = {"Name" = "foo", "Notes"="bar"}, "2" = {.....
I can access the fields easily when the keynames are strings, but with
numbered keys params[ata][1] doesn't work. Also params[Data].each do
|data| leads to errors,,,
I would like to get a way of accessing the hashes inside data for
creating new database entries in rails.