Ruby Parse String Into Array In Javascript Functions