# Sending whole rows of data from a form

**URL:** <https://www.ruby-forum.com/t/sending-whole-rows-of-data-from-a-form/120909>\
**Category:** Rails\
**Created:** [November 21, 2007, 6:06pm UTC](https://www.ruby-forum.com/t/sending-whole-rows-of-data-from-a-form/120909 "2007-11-21T18:06:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ehudros](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/3ec8ea/32.png) [@ehudros](https://www.ruby-forum.com/u/ehudros)\
**Post date:** [November 21, 2007, 6:06pm UTC](https://www.ruby-forum.com/t/sending-whole-rows-of-data-from-a-form/120909/1 "2007-11-21T18:06:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ehudros](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/3ec8ea/32.png) [@ehudros](https://www.ruby-forum.com/u/ehudros)\
**Post date:** [November 21, 2007, 6:47pm UTC](https://www.ruby-forum.com/t/sending-whole-rows-of-data-from-a-form/120909/2 "2007-11-21T18:47:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ehudros](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/3ec8ea/32.png) [@ehudros](https://www.ruby-forum.com/u/ehudros)\
**Post date:** [November 25, 2007, 10:02am UTC](https://www.ruby-forum.com/t/sending-whole-rows-of-data-from-a-form/120909/3 "2007-11-25T10:02:29Z")

</div>

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.
