# How can I do that? Text with paragraphs in show

**URL:** <https://www.ruby-forum.com/t/how-can-i-do-that-text-with-paragraphs-in-show/126144>\
**Category:** Rails\
**Created:** [January 15, 2008, 8:23pm UTC](https://www.ruby-forum.com/t/how-can-i-do-that-text-with-paragraphs-in-show/126144 "2008-01-15T20:23:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![captaffy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f04885/32.png) [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Post date:** [January 15, 2008, 8:23pm UTC](https://www.ruby-forum.com/t/how-can-i-do-that-text-with-paragraphs-in-show/126144/1 "2008-01-15T20:23:37Z")

</div>

I have this in code in show:

**Observation:**

> \<%=h @repair\_ticket.observation %\>

The observation is text. When I edit this observation, I put “.”,  
creating several paragraphs, but when I go to show, the view gives me  
all the text in one line (not doing the paragraphs I made)

---

<div class="post-metadata">

**Author:** ![captaffy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f04885/32.png) [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Post date:** [January 15, 2008, 10:18pm UTC](https://www.ruby-forum.com/t/how-can-i-do-that-text-with-paragraphs-in-show/126144/2 "2008-01-15T22:18:45Z")

</div>

On 1/15/08, John S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I have this in code in show:
> 
> **Observation:**
> 
> > \<%=h @repair\_ticket.observation %\>
> 
> The observation is text. When I edit this observation, I put “.”,  
> creating several paragraphs, but when I go to show, the view gives me  
> all the text in one line (not doing the paragraphs I made)

@repair\_ticket.observation.gsub( /\n/, ‘  
’ )

I’d put in a helper of course.

–  
Greg D.  
[http://destiney.com/](http://destiney.com/)

---

<div class="post-metadata">

**Author:** ![captaffy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f04885/32.png) [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Post date:** [January 15, 2008, 10:48pm UTC](https://www.ruby-forum.com/t/how-can-i-do-that-text-with-paragraphs-in-show/126144/3 "2008-01-15T22:48:21Z")

</div>

Greg D. wrote:

> On 1/15/08, John S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > I have this in code in show:
> > 
> > **Observation:**
> > 
> > > \<%=h @repair\_ticket.observation %\>
> > 
> > The observation is text. When I edit this observation, I put “.”,  
> > creating several paragraphs, but when I go to show, the view gives me  
> > all the text in one line (not doing the paragraphs I made)
> 
> @repair\_ticket.observation.gsub( /\n/, ‘  
> ’ )
> 
> I’d put in a helper of course.
> 
> –  
> Greg D.  
> [http://destiney.com/](http://destiney.com/)

I have the same problem.

In repair\_tickets controller, in the edit method, i have:  
@repair\_ticket.observation = “I have to put a string here with  
paragraphs”

What string should I put there?
