Passing an Array to a hidden field

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?



This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs