# Passing an Array to a hidden field

**URL:** <https://www.ruby-forum.com/t/passing-an-array-to-a-hidden-field/94396>\
**Category:** Rails\
**Created:** [May 3, 2006, 6:57pm UTC](https://www.ruby-forum.com/t/passing-an-array-to-a-hidden-field/94396 "2006-05-03T18:57:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dukael](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c77e96/32.png) [@dukael](https://www.ruby-forum.com/u/dukael)\
**Post date:** [May 3, 2006, 6:57pm UTC](https://www.ruby-forum.com/t/passing-an-array-to-a-hidden-field/94396/1 "2006-05-03T18:57:29Z")

</div>

I have been trying to figure out the best way to pass an array back  
and forth between a hidden field in a form and a controller. I am  
working on an app that the user can add group members to and decided  
the best and most user friendly is to show the user a text field to  
input the name of the member. This field has auto complete on it.  
When they submit the member is added to an array in the controller  
until the whole form is complete (it is possible for 10,000 members  
to be available and having a multiselect box is not pretty that big).

The adding of members to the group happens at group creation.  
Currently I am converting the array to a string seperated by commas  
and than taking that string once submitted and parsing it into an  
array. It works however I am not happy with the solution as it seems  
like extra work that doesn’t need to be done. Is it possible to put  
an array in a hidden field, I have tried and failed but could be  
doing something wrong? Or is there another way to do what I am trying  
to do that is easier and better than what I am doing now?

Thanks

Andrew
