How can I convert these:
[172592596,93038592,154137572]
To look like these:
['172592596','93038592','154137572']
How can I convert these:
[172592596,93038592,154137572]
To look like these:
['172592596','93038592','154137572']
If you want to turn an array of ints into an array of strings, you can do so easily using map and to_s.
arr = [172592596,93038592,154137572]
arr.map {|x| x.to_s}
#=> ["172592596", "93038592", "154137572"]
Since this is rails, you can also do (will also work in plain ruby if the version is at least 1.8.7):
arr.map(&:to_s)
To get the same result.
{"id":"333","id":"444"} is a syntax error. You can't use string keys using the : syntax with string keys. If you change it {"id" => "333", "id" => "444"} it still doesn't work because you can't have duplicate keys in a hash.