Reputation: 4634
I have an array, and I need to print these value line by line in a textarea
.
According to the answer.
I thought I can print html
by this way.
<textarea id="t">Line 1 Line 2</textarea>
Therefore, here is what I wrote.
Note: @parameter = ["Line1", "Line2"]
<span class="edit">
<%= text_area_tag('list', @parameter.join(' '))%>
</span>
However, I got this
instead of this
Upvotes: 0
Views: 348
Reputation: 23661
Can you try with or "\n"
<span class="edit">
<%= text_area_tag('list', @parameter.join("\n"))%>
</span>
Upvotes: 2