Topic: Adding a line break.. safely
I have a standard text area, the contents which gets saved to the db and then rendered again:
<%= text_area 'review', 'review_body', :cols => 50, :rows => 8 %>
I render it using sanitize and simple format:
<%= simple_format(sanitize(review.review_body)) %>
My issue is that it removes any extra line breaks so for instance if the user inputs
foo
bar
It comes out as
foo
bar
Is there any way to preserve the line breaks? Maybe a still safe alternative to simple_format?