Very basic Rails 3 HAML scaffold generator
Pull request Compare This branch is 5 commits behind psynix:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
scaffold Another stupid typo fixed: replaced 'th' with 'td' in table body. Feb 8, 2010


Rails 3 HAML Scaffold Generator

Essentially just a copy of the Rails 3 ERB generator with HAML replacements for the templates.

Original idea from Paul Barry's article on custom genrators


  1. Generate your new rails application:

    rails ApplicationName
    cd ApplicationName
  2. Edit "Gemfile" and add "gem haml" to the gem list

  3. Either

    gem install haml


    bundle install
  4. Run

    haml --rails .
  5. Edit config/application.rb and add the following:

    config.generators do |g|
        g.template_engine :haml
  6. Either

    git clone git:// lib/generators/haml


    git submodule add git:// lib/generators/haml
  7. Create stuff with:

    rails generate controller ControllerName index
    rails generate mailer ExamplesNotifications
    rails generate scaffold FancyModel

    ... or if you like to mix it up with ERB, ignore step 5 and use ...

    rails generate haml:controller ControllerName index
    rails generate haml:mailer ExamplesNotifications
    rails generate haml:scaffold FancyModel


  • Gemify (?)