Ruby on Rails with Haml - how to switch from erb

I am switching to HAML from erb files. I added gaml gem to my system. I created the file app / views / layouts / application.html.haml. Should I just delete the application.html.erb file?

There is also a /public/index.html file that displays as the default page. I want to create my own default index.html.haml page. Where to place it and how to make the system display this file instead of the standard index file?

Thank!

+5
source share
2 answers

Yes, you can simply delete the ERB version of any conversions converted to HAML.

, public/index/html. PagesController , , , " " .

:

root :to => "pages#index"
+5

u erb, script

for i in `find app/views -name '*.erb'` ; do html2haml -e $i ${i%erb}haml ; rm $i ; done

index.html

+3

All Articles