Skip to content
Daniel Kehoe edited this page May 24, 2011 · 10 revisions

Using Haml with Rails

If you are creating an application template, this step uses the haml recipe from the rails_apps_composer repository.

Here are instructions for adding Haml to Rails.

The example apps from the Rails Apps repository use the default “ERB” Rails template engine. Optionally, you can use another template engine, such as Haml. You’ll need extra gems in the Gemfile for Haml:

gem 'haml', '>= 3.1.1'
gem 'haml-rails', '>= 0.3.4', :group => :development

Run the gem bundler command:

$ bundle install

With the haml-rails gem, there is no need to modify the application.rb file to accommodate Haml. Any time you generate a controller or scaffold, you’ll get Haml instead of ERB templates. And when your Rails application loads, Haml will be loaded and initialized.

Clone this wiki locally