refactor inline js to create.js.haml