# Displaying Text\_Area values in HTML

**URL:** <https://www.ruby-forum.com/t/displaying-text-area-values-in-html/172653>\
**Category:** Rails\
**Created:** [July 24, 2009, 5:05pm UTC](https://www.ruby-forum.com/t/displaying-text-area-values-in-html/172653 "2009-07-24T17:05:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![c\_dekker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/b782af/32.png) [@c\_dekker](https://www.ruby-forum.com/u/c_dekker)\
**Post date:** [July 24, 2009, 5:05pm UTC](https://www.ruby-forum.com/t/displaying-text-area-values-in-html/172653/1 "2009-07-24T17:05:56Z")

</div>

This is one of those problems thats probably too simple to be written  
down somewhere and that is why I cant find it in any help or through  
google.

I have a model which has a description. This description is entered  
through a text\_area (multiline). For example:

===  
This is line one.

# This ie line two

Now whenever I want to display this value read-only in one of my views I  
cant simply do \<%= @model.description %\>. This will cause the text to be  
printed as:  
‘This is line one.This is line two’

How do I get the text to be displayed correctly with, I guess, HTML  
  
 and other escape characters included? Im sure there should be a  
helper or something that accomplishes this already in Rails 2.3.2

---

<div class="post-metadata">

**Author:** ![c\_dekker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/b782af/32.png) [@c\_dekker](https://www.ruby-forum.com/u/c_dekker)\
**Post date:** [July 24, 2009, 6:05pm UTC](https://www.ruby-forum.com/t/displaying-text-area-values-in-html/172653/2 "2009-07-24T18:05:31Z")

</div>

On Jul 24, 4:05 pm, “C, D.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Now whenever I want to display this value read-only in one of my views I  
> cant simply do \<%= @model.description %\>. This will cause the text to be  
> printed as:  
> ‘This is line one.This is line two’
> 
> How do I get the text to be displayed correctly with, I guess, HTML  
>   
> and other escape characters included? Im sure there should be a  
> helper or something that accomplishes this already in Rails 2.3.2

simple\_format does that.

Fred
