Ruby Parse String Into Array Javascript