Hi guys,
I got a small problem. I want to give a text_area a default value.
The default value is a range of numbers, seperated with a comma.
So the first thing which is given is a String that looks like followed:
some_string = "100,101,102,103,104,105"
Now there is a text_area given. It content should be the String
"some_string". The ouput should look like this here:
100,
101,
102,
103,
104,
105
So after each "comma" new line.
My idea was to convert the String to an Array and print each element of
the Array. But it did not work. Here is what it is looking like:
<%= f.text_area :number, :value => s.some_string.nil? "" :
s.some_string.split(',').each {|number| puts "#{number}," } %>
It will print this here:
["100","101","102","103","104","105"] which is not the result that i was
looking for. (mentioned above)
Any ideas?
--
Posted via
http://www.ruby-forum.com/.