I will leave it as a memorandum.
gemfile
gem "haml-rails"
Terminal
bundle install
Terminal
rails haml:erb2haml
Terminal
Would you like to delete the original .erb files? (This is not recommended unless you are under version control.) (y/n)
y
Deleting original .erb files.
You will be asked if you want to delete the original erb file. Answer with y or n.
That's it!
Since haml does not need to close the tag, the amount of code can be reduced and simplified, but due to indent management, an error will occur if there is any deviation. However, no matter who writes it, it has a similar structure and is highly readable, so I would like to actively use it.
Recommended Posts