I have a textarea form which takes a large block of text. In this text area, I do a carriage return to end the paragraph and another carriage return to separate the paragraphs.
That text is in @contact_postalcard.message.
However, I need to output into an HTML file. The HTML file has been loaded as a long string which contains ‘ReplaceThisWithPostalcardMessage’ in it. I want to gsub the text from @contact_postalcard.message for ReplaceThisWithPostalcardMessage.
The problem is that the HTML file does not have any
tags for each carriage return. As a result, I get one long run-on paragraph.
How can I format the substituted value in the HTML file properly?
addr_template = addr_template.gsub(/ReplaceThisWithPostalcardMessage/, @contact_postalcard.message)
How about this?