# Ajax passing params array

**URL:** <https://www.ruby-forum.com/t/ajax-passing-params-array/149454>\
**Category:** Ruby\
**Created:** [September 25, 2008, 12:38am UTC](https://www.ruby-forum.com/t/ajax-passing-params-array/149454 "2008-09-25T00:38:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![monica](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a183cd/32.png) [@monica](https://www.ruby-forum.com/u/monica)\
**Post date:** [September 25, 2008, 12:38am UTC](https://www.ruby-forum.com/t/ajax-passing-params-array/149454/1 "2008-09-25T00:38:47Z")

</div>

Hi there,

I’ve got a problem trying to send an array in an Ajax.Updater call… I  
need help, may anyone take a look at this? ☹

I have an array called customers in the javascript method which contain  
@customer objects. I need to send it in the ajax request, and I’ve tried  
several things without success:

a)  
new Ajax.Updater(‘content\_search’, ‘/crmcustomers/content\_search’,  
{parameters: {array[]: customers}});

b)  
new Ajax.Updater(‘content\_search’, ‘/crmcustomers/content\_search’,  
{parameters: customers, method: ‘post’});

c) (this is the closest one I think… it gives me an array whose size is  
zero… but at least it’s an array!)  
new Ajax.Updater(‘content\_search’, ‘/crmcustomers/content\_search’,  
{parameters: “customers\_array[] = ‘\<%=@customers%\>’”});

I’ve tried quite a lot more things looking at a lot of topics in this  
forum, and I’m really stuck on this.

I think I’m missing both sides: the way of sending the array by params  
in the ajax request, and the way of retreiving the array in the action  
‘content\_search’ in my controller!

Any help will be very very welcome…

Many thanks!

Monica
