I use a text area to collect comments from the user. The text area preserves the next line and white space indentation.
While displaying the comment in a p
tag the next line and white space indentation at the beginning of the line are lost.
I enter the following text in the text area:
Lorem ipsum dolor sit amet,
consectetur adipisicing elit,
sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua
The form save preserves the next line in the comment.
I display the comment as:
%p #{@user.comment}
This displays the following text:
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua
How do I display the saved text with correct whitespaces?