views:

547

answers:

3

Hi I have the rails project, the views only consist with HTML.ERB files , my client wants to convert ERB to HAML. I have too many views file.. its get huge time to convert file by file . So that any simply way i can able to convert html to haml... i install haml plugin under my project

+2  A: 

There you go: http://html2haml.heroku.com/

Mike Williamson
+1  A: 

You can use from the command line html2haml

html2haml your_erb_file new_haml_file

If you convert all your files in one command, look at this article : http://shifteleven.com/articles/2008/06/08/converting-erb-to-haml-snippet

Mike
A: 

EDIT: html2haml does work as advertised, however you must use version obtained from the current master branch of the haml github repoistory.

The version of html2haml included with the haml gem currently available from rubygems is no good. This is the version you will get if you were to do gem install haml right now. Using the version supplied with the gem will result in invalid haml, as it cannot process ruby properly.

EmFi