Convert rjs to jquery script