Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > ajax passing params array

Reply
Thread Tools

ajax passing params array

 
 
Monica Saiz
Guest
Posts: n/a
 
      09-24-2008
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
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LFSR calcs, passing params. Niv (KP) C Programming 3 05-16-2009 08:58 AM
FormView's ODS not passing correct insert params to BLL. How to debug this? bogdan ASP .Net 0 04-10-2008 12:23 PM
Ajax invoke WebMethod with *out* Params ckkwan@my-deja.com ASP .Net 4 03-14-2008 07:34 AM
AJAX IDE and AJAX TOOL--The Release of JoyiStar AJAX WebShop 3 Beta minnie Java 1 12-13-2006 06:29 AM
params v.s. @params in rails? Barry Ruby 9 09-15-2005 03:12 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57