I am in the process of switching to HAML from erb files. I added the haml gem to my system. I created the app/views/layouts/application.html.haml file. Should I just delete the application.html.erb file?
Also, there is still the /public/index.html file which gets rendered as the default page. I want to make my own default index.html.haml page. Where do I place it and how do I make the system render that file instead of the default index file?
Thanks!
Yes you can just delete the ERB version of any views you have converted over to HAML.
As for your other question, delete the public/index/html file. Next, you may want to add a PagesController and have an action in there like index, and a corresponding view, and put your "home page" stuff in there.
Then in your routes file, add:
root :to => "pages#index"
u can autoconvert and delete all erb files using this script
for i in `find app/views -name '*.erb'` ; do html2haml -e $i ${i%erb}haml ; rm $i ; done
And simply delete index.html in public folder
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With