Text input -> array

Im rather new to ror, and Iv’e faced a problem. I want a user to input
som words from a form ie. ‘Blue, Green, Yellow’ and so on. And then
convert the (string?) to an array, with each word in a different
position (1)Blue (2)Green (3)Yellow, and then later put it in a
dropdownlist. But that’s a later step… Hehe.

uhm, hope i didn’t explained to bad, and hope anyone can help and
explain in a … uhm… ‘easy’ way, heh.
Thanks in advance!

Maybe something like ‘Blue, Green, Yellow’.split /,\s*/

Fred

Frederick C. wrote:

Maybe something like ‘Blue, Green, Yellow’.split /,\s*/

Fred

Thanks alot, it did solve the it!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs