devise 1.2以上だとhamlのgeneratorがないので、How To: Create Haml and Slim Viewsを読んでやるんだけど、少しハマったのでメモ。
他にもerbで作ったアプリケーションをhaml記法に移行したいときなど。
hamlのバージョンが古いとひっかかるので、Gemfileに
gem 'haml', '~> 4.0.0'
gem 'haml-rails', '~> 0.4'
group :development do
gem 'html2haml'
end
とかいて、html2hamlをbundle execつけて実行する。
for file in app/views/odai/*.erb; do bundle exec html2haml -e $file ${file%erb}haml --trace && rm $file; done
動いた。