I thought I knew how to do this, but it''s not working. I''m
passing an
array of ids to a ruby controller with an HTTPService call.. It''s
getting the call but it''s only using the first value. The url is like
so (GET for clarity)
/league/getopenleagues/dbg_12345?friends=dbg_12346&friends=dbg_12347
In the controller I am grabbing those ids and shoving them into a find
query in a comma seperated list so that I can do a "NOT IN" condition.
I''m probably doing this poorly, but I''m doing it like this:
      friendsList = Array.new
      params[:friends].each do |friend|
        friendsList.push("''"+friend+"''");
      end
and then in the conditions I do:
network_id NOT IN (#{friendsList.join(",")})
First off - is there a better way to do that without the intermediary
steps? And also, why is this not working - it doesn''t think
it''s an
array?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-Mar-16  11:00 UTC
Re: Passing an array to a Ruby controller (from AJAX)
> > First off - is there a better way to do that without the intermediary > steps? And also, why is this not working - it doesn''t think it''s an > array?IIRC you need to call your parameter friends[] for rails to treat it like an array. Fred --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---