Ruby On Rails

how to convert html.erb to haml in rails



Video helps you to get information about convert html.erb file to haml in ruby on rails

1. Add following gems in gem file

gem ‘haml’

gem ‘haml-rails’

And Do bundle install

2. Following command will help us to convert all html/erb to haml

find . -name *.erb -print | sed ‘p;s/.erb$/.haml/’ | xargs -n2 html2haml

3. Following command will help us to delete all erb file from views folder

find ./app/views -name “*.html.erb” -print0 | xargs -0 rm

Don’t forget to subscribe…

Similar Posts

3 thoughts on “how to convert html.erb to haml in rails

Leave a Reply

Your email address will not be published. Required fields are marked *