Ruby Parse String Into Array Js Functions