views:

69

answers:

2

When i populate a textarea with text using \r\n (carriage return - newline) the text is formatted improperly [UPDATE: \r\n is what is generated when filling out a textarea, i'm simply pulling from a database what was previously filled in. Also to note, in the production environment i don't seem to have this problem. END UPDATE] For example:

%textarea  
  = "hello\r\nHow are you?"

comes out like this:

hello  
        How are you?

I'm thinking this might have something to do with HAML. Can anyone help me out? Note: if i use \n\r it works fine, but thats technically incorrect and id have to do some gsubs to reverse them for proper display.

A: 

Changing

%textarea  
  = "hello\r\nHow are you?"  

to

%textarea "hello\r\nHow are you?"

all on one line seems to have solved the problem. I guess that means it was a HAML issue.

Mike
+1  A: 

See this Haml FAQ.

nex3
Thank you nex3!
Mike