Quick and useful code snippet that you may want to use eg. while upgrading some old Rails projects. That HAML awesomeness you should use, Luke!
Depending on your configuration (I’m using RVM for example) you may want to add those gems to your Gemfile:
1 2 3
Here’s the code:
1 2 3 4
Description of html2haml options:
Parse ERb tags.
Parse the input using the more strict XHTML parser.
Drop this file into your rails root directory and just run it. You may want to review the code of you new HAML files and delete those old nasty erbs. Have fun!