From: James Edward Gray II Date: 2007-04-05T01:11:17+09:00 Subject: Re: Problem Extracting Array Values On Apr 4, 2007, at 11:05 AM, Dustin Anderson wrote: > unknown wrote: >> On Wed, 4 Apr 2007, Dustin Anderson wrote: >> >>> Thanks Chris, ilan, Ryan for the help... You got it exactly correct. >>> into my javascript. Otherwise, I'll need a helper to construct the >>> string to look like this. >> >> not really >> >> values = ["block1_name", "block2_name", "block3_name"] >> >> javascript = "value = #{ values.inspect }" >> >> fyi. >> >> -a > > is there a simple way in ruby to build an array from a string like > this: > > block1,block2,block3 to an array that is like this: > > ["block1", "block2", "block3"] Sure: >> "block1,block2,block3".split(",") => ["block1", "block2", "block3"] James Edward Gray II