Passing an array to a Ruby controller (from AJAX)

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?

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