Ruby/Rails - Properly Display/Format Text From The Text Area Form Control

I have a interesting problem. I have a :text field in my model with displays a large chunk of data, usually about three paragraphs.

When I enter the text in on the new view it might look like....

aaaaaaaaaaaaaaaaaaaaaaaaa.
bbbbbbbbbbbbbbbbbbbbbbbbbbbb.
ccccccccccccccccccccc.

Imagining that each a,b, or c is an individual paragraph.

With a space between the a, b, and c lines....(e.g. the line break that occurs when you press enter)

But when I display the very same data on the view, the line breaks are not recognized. The view seems to concatenate all the text into one big blurb and it displays like.....

aaaaaaaaaaaaaaaaaaaaaaaaa.bbbbbbbbbbbbbbbbbbbbbbbbbbbb.ccccccccccccccccccccc.

But the line breaks are being recorded because going to edit shows the data in the format with the line breaks.

I thought about adding < p >'s into the text area and parsing the html on the view but that really isn't a good option since I dont want to require my users to insert html tags.

Is there something I'm missing to get the text area to display in the same fashion as it was entered?

15
задан ChrisWesAllen 23 March 2011 в 01:29
поделиться