1. Computing

Using Haml with Sinatra

By , About.com Guide

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.

%br/
  1. About.com
  2. Computing
  3. Ruby
  4. Tutorials
  5. Sinatra
  6. Using Haml with Sinatra

©2013 About.com. All rights reserved.