Saturday, March 5, 2011

Rails 3.0: Installing Haml

Installing Haml is easy. Open up Gemfile.
gem 'haml'

Install.
bundle install

Now start naming your HTML files with a .haml extension, such as index.html.haml.

Cheat Sheet

Here's a quick cheat sheet to get you started.
#id
.class
%tag
%a{ :href => 'http://wesleymwwong.blogspot.com' }
/ HTML comment
= output
&= escaped output
!= not escaped output
- ruby
-# ruby comment
#{ inline ruby }
:javascript
!!! strict
!!! 5

References