ajax passing params array

Discussion in 'Ruby' started by Monica Saiz, Sep 24, 2008.

  1. Monica Saiz

    Monica Saiz Guest

    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/.
    Monica Saiz, Sep 24, 2008
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    4
    Views:
    2,392
    DSK Chakravarthy
    Mar 14, 2008
  2. bogdan
    Replies:
    0
    Views:
    398
    bogdan
    Apr 10, 2008
  3. Niv (KP)

    LFSR calcs, passing params.

    Niv (KP), May 13, 2009, in forum: C Programming
    Replies:
    3
    Views:
    588
    Barry Schwarz
    May 16, 2009
  4. Paul Vudmaska

    passing multi params

    Paul Vudmaska, Apr 21, 2004, in forum: Ruby
    Replies:
    2
    Views:
    97
    Mark Sparshatt
    Apr 21, 2004
  5. Barry
    Replies:
    9
    Views:
    443
    Ara.T.Howard
    Sep 15, 2005
Loading...

Share This Page