I have an array (which is technically a string) of id numbers.
ids = "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]"
I want to make the ids into an array that looks like this:
ids = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
The only way I've found to do this is to use map.
id_numbers = ids.split(/,\s?/).map(&:to_i)
However, this lops off the first number in the array and replaces it with 0.
id_numbers = [0, 2, 3, 4, 5, 6, 7, 8, 9, 10]
Is there a better way to go about converting a string array into a regular array?