Corrections of 'if' with ruby in javascript files