erbもっと楽に書きたい!
Gemfile以下を記載。
gem "haml-rails", "~> 2.0"
以下のコマンドでerb->hamlに変換。Rails5以降、rakeコマンドをrailsコマンドで叩けるようになった。
$ rails haml:erb2haml
変換元の.erbファイル消しても大丈夫?って聞かれる。
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.
サーバーの再起動を忘れずに。
$ rails s