# Leading blanks in text areas

**URL:** <https://www.ruby-forum.com/t/leading-blanks-in-text-areas/82490>\
**Category:** Rails\
**Created:** [January 19, 2007, 4:30pm UTC](https://www.ruby-forum.com/t/leading-blanks-in-text-areas/82490 "2007-01-19T16:30:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jankers](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b9e5f3/32.png) [@jankers](https://www.ruby-forum.com/u/jankers)\
**Post date:** [January 19, 2007, 4:30pm UTC](https://www.ruby-forum.com/t/leading-blanks-in-text-areas/82490/1 "2007-01-19T16:30:52Z")

</div>

I’ve been struggling with this for a while now and I give up. I  
searched and searched but couldn’t find the answer either. My edit  
form has a text area with the following HTML

**Description**  
  
  
\<%=@workout.description%\>

Whenever the page loads, 10 extra blank spaces are in the text box  
before the description. The spaces are not in the database. If I don’t  
remove them before saving, the blanks get saved to the database. Any  
ideas on why this is happening? I changed the code to an input field  
and the problem goes away.

Thanks,  
jankers

---

<div class="post-metadata">

**Author:** ![jankers](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b9e5f3/32.png) [@jankers](https://www.ruby-forum.com/u/jankers)\
**Post date:** [January 19, 2007, 4:31pm UTC](https://www.ruby-forum.com/t/leading-blanks-in-text-areas/82490/2 "2007-01-19T16:31:55Z")

</div>

On 09/01/07, jankers [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ```
> <p><b>Description</b><br>
> <textarea cols="40" id="workout_description"
> 
> ```
> 
> name=“workout[description]” rows=“5” wrap=“virtual”\>  
> \<%=@workout.description%\>
> 
> Whenever the page loads, 10 extra blank spaces are in the text box  
> before the description. The spaces are not in the database.

Change it to:

\<%=@workout.description%\>

(ie, remove the line break after your textarea tag) and you should be  
set.

…j

---

<div class="post-metadata">

**Author:** ![jankers](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b9e5f3/32.png) [@jankers](https://www.ruby-forum.com/u/jankers)\
**Post date:** [September 25, 2007, 10:43pm UTC](https://www.ruby-forum.com/t/leading-blanks-in-text-areas/82490/3 "2007-09-25T22:43:34Z")

</div>

If i look at your html code it looks like there are ten spaces after  
the start textarea tag and the \<%=…

Rasmus
