The caveat is that you also have to move all other script tags from your views to the bottom of the page. This can be done with helpers.
<head> to the end of the
<body> tag, and add one extra line, like this:
In your ERB views change
In your Haml views change