# New line char in a text area field on DISPLAY

**URL:** <https://www.ruby-forum.com/t/new-line-char-in-a-text-area-field-on-display/102262>\
**Category:** Rails\
**Created:** [August 14, 2006, 6:20am UTC](https://www.ruby-forum.com/t/new-line-char-in-a-text-area-field-on-display/102262 "2006-08-14T06:20:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![thila](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/3d9bf3/32.png) [@thila](https://www.ruby-forum.com/u/thila)\
**Post date:** [August 14, 2006, 6:20am UTC](https://www.ruby-forum.com/t/new-line-char-in-a-text-area-field-on-display/102262/1 "2006-08-14T06:20:57Z")

</div>

I have a text\_area to accept upto 1000 chars, which is stored as a blob  
in mysql. When I try to display the saved data, I dont see the new line  
characters - however I could see the newline characters in EDIT MODE. So  
my newline char is lost during displaying. Any ideas how to fix it.  
thanks  
thila

---

<div class="post-metadata">

**Author:** ![thila](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/3d9bf3/32.png) [@thila](https://www.ruby-forum.com/u/thila)\
**Post date:** [August 15, 2006, 2:20pm UTC](https://www.ruby-forum.com/t/new-line-char-in-a-text-area-field-on-display/102262/2 "2006-08-15T14:20:27Z")

</div>

newlines are not rendered in html except within certain tags. they  
have to be converted to breaks or paragraph tags.

try

\<%= simple\_format(your\_text) -%\>

Chris

---

<div class="post-metadata">

**Author:** ![thila](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/3d9bf3/32.png) [@thila](https://www.ruby-forum.com/u/thila)\
**Post date:** [September 29, 2006, 3:23pm UTC](https://www.ruby-forum.com/t/new-line-char-in-a-text-area-field-on-display/102262/3 "2006-09-29T15:23:38Z")

</div>

Chris H. wrote:

> newlines are not rendered in html except within certain tags. they  
> have to be converted to breaks or paragraph tags.
> 
> try
> 
> \<%= simple\_format(your\_text) -%\>
> 
> Chris

Thanks for the info. It also helped me out. 🙂  
BTW, I’m also wondering if there is any function or plugin that  
recognizes URL link within the text?

---

<div class="post-metadata">

**Author:** ![thila](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/3d9bf3/32.png) [@thila](https://www.ruby-forum.com/u/thila)\
**Post date:** [September 29, 2006, 4:52pm UTC](https://www.ruby-forum.com/t/new-line-char-in-a-text-area-field-on-display/102262/4 "2006-09-29T16:52:47Z")

</div>

On Sep 29, 2006, at 3:23 PM, Jay L. wrote:

> Thanks for the info. It also helped me out. 🙂  
> BTW, I’m also wondering if there is any function or plugin that  
> recognizes URL link within the text?

Yep, it is called auto\_link.

– fxn
