# Dumb newbie question - text formatting?

**URL:** <https://www.ruby-forum.com/t/dumb-newbie-question-text-formatting/93935>\
**Category:** Rails\
**Created:** [April 15, 2006, 2:14am UTC](https://www.ruby-forum.com/t/dumb-newbie-question-text-formatting/93935 "2006-04-15T02:14:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![adambeazley](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/5f9b8f/32.png) [@adambeazley](https://www.ruby-forum.com/u/adambeazley)\
**Post date:** [April 15, 2006, 2:14am UTC](https://www.ruby-forum.com/t/dumb-newbie-question-text-formatting/93935/1 "2006-04-15T02:14:54Z")

</div>

I have a MySQL “text” element that I’m trying to display, but it’s not  
formatting (i.e. it’s all one big paragraph). In the AWD depot example  
it doesn’t look like they do anything special, but they get formatted  
text. I’ve tried it with both:

\<%= show.description %\> - puts text, and formats according to any HTML  
tags I typed in.

and

\<%= h(show.description) %\> - puts text and HTML tags, no formatting.

What am I missing?

Thanks,

Adam

---

<div class="post-metadata">

**Author:** ![adambeazley](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/5f9b8f/32.png) [@adambeazley](https://www.ruby-forum.com/u/adambeazley)\
**Post date:** [April 15, 2006, 2:21am UTC](https://www.ruby-forum.com/t/dumb-newbie-question-text-formatting/93935/2 "2006-04-15T02:21:35Z")

</div>

Hi Adam,

Try simple\_format, shown here:

> **[ActionView::Helpers::TextHelper](https://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html)**
>
> The TextHelper module provides a set of methods for filtering, formatting and transforming strings, which can reduce the amount of inline Ruby code in your views.

3

This page also has other helpful text helpers

Daniel

---

<div class="post-metadata">

**Author:** ![adambeazley](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/5f9b8f/32.png) [@adambeazley](https://www.ruby-forum.com/u/adambeazley)\
**Post date:** [April 15, 2006, 3:00am UTC](https://www.ruby-forum.com/t/dumb-newbie-question-text-formatting/93935/3 "2006-04-15T03:00:30Z")

</div>

Daniel H. wrote:

> Hi Adam,
> 
> Try simple\_format, shown here:  
> [ActionView::Helpers::TextHelper](http://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#M00051)  
> 3
> 
> This page also has other helpful text helpers
> 
> Daniel

That’s awesome. Thanks.

-Adam

---

<div class="post-metadata">

**Author:** ![adambeazley](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/5f9b8f/32.png) [@adambeazley](https://www.ruby-forum.com/u/adambeazley)\
**Post date:** [April 15, 2006, 1:50pm UTC](https://www.ruby-forum.com/t/dumb-newbie-question-text-formatting/93935/4 "2006-04-15T13:50:34Z")

</div>

Adam B. wrote:

> \<%= h(show.description) %\> - puts text and HTML tags, no formatting.
> 
> What am I missing?

In the depot example Dave T. was using HTML tags to format his  
descriptions (and that’s why he didn’t use h() to escape them).

regards

Justin
