I''m not 100% sure what you''re asking for, but if you have a
"Word"
activerecord table with 2 columns(id, words), here is some code that will
give you what you want.
words = Word.find(:all)
fruits = words.map{|word|word.words}.join(" ").split(" ")
On 4/11/06, Paul Livingstone <livingstone.paul@gmail.com>
wrote:>
> I''ve got a bunch of records coming back from a database like so
>
> ID WORDS
> 1. banana apple orange
> 2. apple pear
> 3. banana orange
>
> I want to take the records in the WORDS field and concatinate them into
> one large array so I can play around with it. How do I do this?
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://wrath.rubyonrails.org/pipermail/rails/attachments/20060411/a00489df/attachment.html