move js to js files, do things the rails way