Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to have blank lines in a .text.haml document?

I'm creating an email notification in a .text.haml document. How does one denote a blank line?

= @variable.name + " , you have a new update."
=
=
= "There has been new activity."

In the above example I would like the two lines that have just the HAML = on them to be blank lines but just having the = signs causes an error. What should I be doing?

like image 986
John Avatar asked Feb 18 '12 21:02

John


1 Answers

Blank lines in a .haml.text document can be created by placing a \ on a line by itself. An example in the form of an email:

Dear #{@user.name},
\
Use a backslash for blank lines in haml text templates.
\
Thanks!

However, HAML is designed for creating HTML documents, not plaintext ones. You really would be better off using erb or something else for this.

like image 123
Jon Avatar answered Oct 07 '22 00:10

Jon