move js from haml to js file