In my Rails 3 application I use textarea to let users to write a new message in a forum.
textarea
However, when the message is displayed, all newlines look like spac
The following helper preserves new lines as line breaks, and renders any HTML or Script (e.g Javscript) as plain text.
def with_new_lines(string) (h(string).gsub(/\n/, '')).html_safe end
Use as so in views
<%= with_new_lines @object.some_text %>