Move the code of javascipt to the js_file under /assets/javascipts