this is an opinionated fork of the vanilla haml-rails
Ruby JavaScript
Switch branches/tags
Clone or download
Pull request Compare This branch is 1 commit ahead, 5 commits behind michaek:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

This fork

This fork assumes you'll be using formtastic, inherited_resources, twitter_bootstrap, and possibly some other things I can't recall at the moment.

One other thing it does, which you might find annoying: it detects fields named 'name' or 'title' and moves them to the beginning of the attributes with special treatment/classes. This seems to me like a better starting point, but it's just a scaffold!

I've added a few hacky lines of code to the test to copy the scaffold generated by the test fixtures to docs/output. That's so we can visually inspect the scaffolds that are generated, in addition to (currently minimal) unit tests.


Haml-rails provides Haml generators for Rails 3. It also enables Haml as the templating engine for you, so you don't have to screw around in your own application.rb when your Gemfile already clearly indicated what templating engine you have installed. Hurrah.

To use it, add this line to your Gemfile:

gem "haml-rails"

Pretty fancy, eh?

Once you've done that, any time you generate a controller or scaffold, you'll get Haml instead of ERB templates. On top of that, when your Rails application loads, Haml will be loaded and initialized completely automatically! The modern world is just so amazing.


Haml generators originally from rails3-generators, and written by José Valim, André Arko, Paul Barry, Anuj Dutta, Louis T, and Chris Rhoden. Tests originally written by Louis T.


Ruby license or MIT license, take your pick.