Populate textarea with Multiple Newlines

I’m having trouble pre-populationg textarea with content that has
multiple newlines. It seems to be treating two \n characters as one
\n character. In fact I believe we have a \r\n\r\n but for some
reason the text area is not showing me the extra new line.

Does anyone have any suggestions?

<%= @content %>

where @content is:

This is paragraph one

This is paragraph two

This is paragraph three

The textarea will show:

This is paragraph one
This is paragraph two
This is paragraph three

Somehow it’s ignoring the multiple line breaks.

Thanks!

I’d like to bump this one – I’ve googled and every answer I find wants
to install some text formatting plugin or use a bunch of JS to fix it –
blech!

In Lasso, this just worked. textarea->MySQL->webpage just plain worked.
I’ve monkeyed with various regex tweaks, with and without h(), and
somehow Ruby or Rails just wants to screw this up.

– gw

-kinetic wrote:

I’m having trouble pre-populationg textarea with content that has
multiple newlines. It seems to be treating two \n characters as one
\n character. In fact I believe we have a \r\n\r\n but for some
reason the text area is not showing me the extra new line.

Does anyone have any suggestions?

<%= @content %>

where @content is:

This is paragraph one

This is paragraph two

This is paragraph three

The textarea will show:

This is paragraph one
This is paragraph two
This is paragraph three

Somehow it’s ignoring the multiple line breaks.

Thanks!

Which browser(s) are you using. Works fine for me in Safari 3.1.1.

~ Mark

On Jun 17, 2008, at 2:36 PM, Greg W. wrote:

I’d like to bump this one – I’ve googled and every answer I find
wants
to install some text formatting plugin or use a bunch of JS to fix
it –
blech!

In Lasso, this just worked. textarea->MySQL->webpage just plain
worked.
I’ve monkeyed with various regex tweaks, with and without h(), and
somehow Ruby or Rails just wants to screw this up.

Ah, geeeeeezzzzz. I was using ‘\n’ instead of “\n” in some validation
parsing.

self.moron!

– gw