Need advice: Two-dimensional array (datagrid) save


Interested in creating a two-dimensional params array that I can use to
save multiple objects.

I am displaying a datagrid, which is comprised of multiple rows, each of
which will be saved to a model object. Each cell (row/column
intersection) value will be saved to a model attribute.

The attribute to which the cell value will be saved is not known before
the submission however, as I’m asking the user to choose from a list of
known object attributes for the data to go into.

Basically a person can upload a spreadsheet and then arbitrarily assign
the column data to particular attributes.

My question revolves around how to manage the rows for ease of saving.

I’m assuming that if each cell is the output of text_field, then I have
to set up unique :names on the text_fields. I know that I can’t do
something like:

<% text_field :obj[], :attr[] %>

Is there any “easy” way to set up my params array to be two dimensional
(first dimension would be objects, 2nd dimension would be attributes) or
do I need to uniquely set up names and then process through them in my
controller method?