Strange TextArea Bug

March 19th, 2008

For a while now, my Ruby application has been plagued with a strange bug in text area fields. Whenever a user updated text in a text area field, 5 spaces would be prepended to the text. If the user hit the update field a few times, you would see the text scoot along to the right 5 spaces at a time. Very strange indeed.

For a while, I thought the problem was somwhere in my CSS file. But, the solution was found by using a Ruby tag instead of the equivilent HTML tag in my Views files.

Replace this:

{text_area_tag("table[column]", @table.column, :size => "100x15")}

With this:

{textarea rows="15" name="table[column]" cols="100"}
{%= @table.column %}
{/textarea}

Entry Filed under: Ruby on Rails

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


Pages

RSS Tweets

RSS Berkman Gender & Tech

Links

Tags

Meta