call JS function in rails app

call function to remove duplicate entries in table