Special Functions for dealing with Whitespace in HAML
Sometimes HAML will generate an unwanted space in your HTML, especially when you mix HAML markup and rails helpers.
For example, this piece of HAML:
Will generate this HTML:
This markup results in a space between the ‘Terms of Service’ link and the period at the end. Note that I also had to escape the period in the HAML markup, otherwise the HAML compiler will throw a syntax error.
An easy way to fix this is to use the succeed method.
There are also precede and surround methods which do what you would expect.
Happy coding.