views:

54

answers:

1

In my Rails app, I want to keep the \n that are inputted in the forms. What I've done so far is output with simple_format(). But the problem is that simple_format wraps the text in < p >< /p > if there is a \n. This is problematic for my chatroom log as I don't want each message to appear in a new paragraph.

What should I do instead?

+1  A: 
text.gsub("\n",'<br/>')
NixNinja