Sending whole rows of data from a form

Hi everyone,
I’m kind of banging my head at this for a while now…
I have a 2 phase process in which a list of email addresses and names
are retrieved from gmail (for example), displayed to the user, and then
he checks the ones he’d like to import. The data displayed to him is not
in the database yet, it is just an array of email objects. The problem
is I don’t know how to send the entire row of data back to the server -
I have multiple checkboxes and I can send them as an array, but how can
I send the data as an array of objects (or any other data structure)?

I hope I was able to explain the problem…

Thanks,
Ehud

On 21 Nov 2007, at 17:06, Ehud R. wrote:

server -
I have multiple checkboxes and I can send them as an array, but how
can
I send the data as an array of objects (or any other data structure)?

This may or may not be what you’re asking, but I’ve found that if you
have a form with

<%= text_field_tag ‘foos[][prop1]’ %>
<%= text_field_tag ‘foos[][prop2]’ %>

<%= text_field_tag ‘foos[][prop1]’ %>
<%= text_field_tag ‘foos[][prop2]’ %>

Then that gets handled by rails as {:foos => [{‘prop1’ => ‘value 1’,
‘prop2’ => ‘value 2’}, {‘prop1’ => ‘baz’, ‘prop2’ => ‘bar’}] }

Fred

If you want to send data back to server then you need to put it into
input fields. How about creating hidden fields as well as displaying
the data, or use disabled fields and modifying the style of the field
so it doesnt look like an input box

Tonypm.