modify javascript loading to Rails Way while fixing associated jqueryujs bug