Rewrite app javascript in coffee script