Haml is a markup language that’s used to cleanly and simply describe the HTML of any web document without the use of inline code. Haml functions as a replacement for inline page templating systems such as PHP, ASP, and ERB, the templating language used in most Ruby on Rails applications. However, Haml avoids the need for explicitly coding HTML into the template, because it itself is a description of the HTML, with some code to generate dynamic content.
you can install haml in two ways
- install from rubygem repository
- install from source
If you prefer installing via bundle, append this line in your Gemfile.
After adding this code to your Gemfile just run “bundle install”. Haml gem give us a full freedom to convert html or erb files to haml, for that you can use
To achive this we have to install two more dependent gems. i prefer you to use that gems in development mode if you are using bundler.
Here is small code snippet which will help you to create a new haml from your erb files and delete the existing erb file in your rails application.