Thursday, April 14, 2011

Convert Haml to ERB

1) script/plugin install http://github.com/cgoddard/haml2erb.git

2) In console:
hamls = Dir["app/views/**/*.haml"] - ['app/views/layouts/screen.html.haml'];
hamls.each do |haml|
puts haml
erb = haml.sub(/\.haml$/, '.erb')
File.open(erb, 'w') do |file|
file.write Haml2Erb.convert(File.read(haml))
end
end

http://makandra.com/notes/544-convert-haml-to-erb