ajax passing params array

M

Monica Saiz

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top