Reputation: 7043
My original text
test\r\n\r\ntest\r\n\r\ntest
View:
p = @property.data
Result in PDF
test test test
I need instead:
test
test
test
Upvotes: 1
Views: 1065
Reputation: 355
Try using simple_format to convert line breaks to html new line tags. This works well with pdf too.
<%= simple_format p %>
Note: If you are using rich text editor (such as trix_editor) .html_safe
will work with line breaks. But in this case, .html_safe
doesn't work in PDFs.
Upvotes: 3