1. Technology
You can opt-out at any time. Please refer to our privacy policy for contact information.

Using Haml with Sinatra


4 of 7

A Quick Haml Tutorial

HTML or XML attributes can be added using the curly brace syntax, or the parenthsis syntax. In the following example, both are demonstrated.

%p{:class => "paragraph"} This is a paragraph
%p(class="paragraph") This is another paragraph

Self-closing tags such as br or img can be done by adding a slash to the end of the tag.


©2014 About.com. All rights reserved.