# Display the RETURN key as a new line?

**URL:** <https://www.ruby-forum.com/t/display-the-return-key-as-a-new-line/186897>\
**Category:** Rails\
**Created:** [April 13, 2010, 11:44pm UTC](https://www.ruby-forum.com/t/display-the-return-key-as-a-new-line/186897 "2010-04-13T23:44:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![davidz101](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f0a364/32.png) [@davidz101](https://www.ruby-forum.com/u/davidz101)\
**Post date:** [April 13, 2010, 11:44pm UTC](https://www.ruby-forum.com/t/display-the-return-key-as-a-new-line/186897/1 "2010-04-13T23:44:24Z")

</div>

In a form field, if i user decides to hit enter to start new lines,  
when they submit, they new lines don’t start as new lines. There is a  
whole stream of text.

How do i make it so if the user hits enter during a text field, it  
dispalys a new line? Thanks

---

<div class="post-metadata">

**Author:** ![davidz101](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f0a364/32.png) [@davidz101](https://www.ruby-forum.com/u/davidz101)\
**Post date:** [April 14, 2010, 3:18am UTC](https://www.ruby-forum.com/t/display-the-return-key-as-a-new-line/186897/2 "2010-04-14T03:18:41Z")

</div>

thanks phillip, it looks great, but I am really relaly bad at reading  
API’s (especially when im not good with a language)

Could u just explain relaly quick what I need to do to get the bare  
minimums working? Thanks!

---

<div class="post-metadata">

**Author:** ![davidz101](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f0a364/32.png) [@davidz101](https://www.ruby-forum.com/u/davidz101)\
**Post date:** [April 14, 2010, 2:42am UTC](https://www.ruby-forum.com/t/display-the-return-key-as-a-new-line/186897/3 "2010-04-14T02:42:23Z")

</div>

> In a form field, if i user decides to hit enter to start new lines,  
> when they submit, they new lines don’t start as new lines. There is a  
> whole stream of text.
> 
> How do i make it so if the user hits enter during a text field, it  
> dispalys a new line? Thanks

simple\_format should do what you want.

> **[ActionView::Helpers::TextHelper](https://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#M001751)**
>
> 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.

---

<div class="post-metadata">

**Author:** ![davidz101](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f0a364/32.png) [@davidz101](https://www.ruby-forum.com/u/davidz101)\
**Post date:** [April 15, 2010, 9:09pm UTC](https://www.ruby-forum.com/t/display-the-return-key-as-a-new-line/186897/4 "2010-04-15T21:09:36Z")

</div>

wow marnen, chill ok? I read the API, but its only like 3 sentences,  
and its not enough info for me to get started. I dont know wehre to  
put those lines.

But now I understand, I watched one of Ryan B. tutorials, and in  
it, one of the things he does is use simple\_format

And let me tell u, what the api said is not comprehendible on how to  
use it. without Ryan B showing us, i would not have gotten it. thanks  
phillip for telling me about simple\_format

---

<div class="post-metadata">

**Author:** ![davidz101](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f0a364/32.png) [@davidz101](https://www.ruby-forum.com/u/davidz101)\
**Post date:** [April 15, 2010, 7:27am UTC](https://www.ruby-forum.com/t/display-the-return-key-as-a-new-line/186897/5 "2010-04-15T07:27:55Z")

</div>

David Z. wrote:

> thanks phillip, it looks great, but I am really relaly bad at reading  
> API’s (especially when im not good with a language)
> 
> Could u just explain relaly quick what I need to do to get the bare  
> minimums working? Thanks!

You’re kidding, right? If you’re too lazy to read documentation, why  
should anyone else do it for you?

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid
