Last Updated: February 25, 2016
·
1.499K
· brain64bit

Beautify your *.html.erb file in Rails project

For example views in rails app is located at app/views, now we need beautify all those files in one command.

First we need htmlbeautifier gem, so :

gem install htmlbeautifier

After that we can use tree and xargs command :

tree app/views -f -i | xargs htmlbeautifier

Now all your erb files, have well format of html.