I have an email in which I show text_body to my users in my rails 3 application.
The problem is that text_body comes with lots of spaces between the lines / paragraphs and when I display it with simple_format to display the formatted text in which it is loaded.
Does anyone know how to remove this to make email look like it should be properly formatted on a page in a browser?
thanks a lot rick
It's pretty fast
text.squeeze(" \t")
It leaves no more than one adjacent space and / or tab anywhere in the text.
- :
text.strip.gsub(/\s*\n\s*/, "\n")
Assuming you're using ERB to create email, keep in mind that <%%> will add a new line in the output. If you want to avoid this new line, use <% -%> instead. (Do not say that this is your problem, but you can look into it.)
https://fooobar.com/questions/1811665/index.html
https://fooobar.com/questions/1811666/how-to-start-an-activity-off-a-broadcastreceiver
https://fooobar.com/questions/1811669/how-to-unset-a-jquery-tab-cookie