1. Computing

Using Haml with Sinatra

By

5 of 7

A Quick Haml Tutorial

There's a special syntax for making div tags with class or id attributes. The following shows both the normal form and the shorthand form.

%div{:class => "title"}
  This is a title
.title
  This is a title
 
%div{:id => "header"}
  This is the page header
#header
  This is the page header
  1. About.com
  2. Computing
  3. Ruby
  4. Tutorials
  5. Sinatra
  6. A Quick Haml Tutorial

©2014 About.com. All rights reserved.