Swap ruby with javascript.