Moved javascript tag to the bottom of body tag. Use content_for for dynamic javascripts.