the simplest way to convert a string that has a delimiter like a comma is just to use the split method
"1,2,3,4".split(',') # "1", "2", "3", "4"]
you can find more info on how to use the split method in the [ruby docs][1]
> Divides str into substrings based on a delimiter, returning an array
> of these substrings.
>
> If pattern is a String, then its contents are used as the delimiter
> when splitting str. If pattern is a single space, str is split on
> whitespace, with leading whitespace and runs of contiguous whitespace
> characters ignored.
>
> If pattern is a Regexp, str is divided where the pattern matches.
> Whenever the pattern matches a zero-length string, str is split into
> individual characters. If pattern contains groups, the respective
> matches will be returned in the array as well.
>
> If pattern is omitted, the value of $; is used. If $; is nil (which is
> the default), str is split on whitespace as if ` ‘ were specified.
>
> If the limit parameter is omitted, trailing null fields are
> suppressed. If limit is a positive number, at most that number of
> fields will be returned (if limit is 1, the entire string is returned
> as the only entry in an array). If negative, there is no limit to the
> number of fields returned, and trailing null fields are not
> suppressed.
[1]:
[To see links please register here]