From: Florian Gilcher Date: 2009-02-26T18:39:04+09:00 Subject: Re: store all the values in a new array values = ary.collect {|elem| elem.ticket_fees } In Rails and newer Ruby environments, you can also do this: values = ary.collect( &:ticket_fees ) On Feb 26, 2009, at 10:12 AM, Remco Swoany wrote: > Hi, > > the array below is the output from a find(:all) > > [# ticket_prijs: #, aantal_pers: 2, > ticket_fees: nil, res_kosten: nil, commissie: nil, ticket_verz: nil, > tax: nil, total_prijs: #, > bet_id: > nil, vertrek_id: "AMS", bestemming_id: "MAD", airline_id: "HV", > cabinclass: nil, type: nil, eligibility: nil, supplier: nil, > heen_datum: > 1020204000, terug_datum: 1049061600, outbound_v: nil, outbound_a: nil, > outbound_vluchtnrs: nil, inbound_v: nil, inbound_a: nil, > inbound_vluchtnrs: nil, reis_verz: #, > annu_verz: #, boeking_status: nil, > enquete_status: 1, holiday_status: 0, eurenq_status: 9, nieuwsbrief: > 99, > reference: nil, kadoboncode: nil, boeking_tijdcode: 1030624003, > servicemail_status: nil, factory_master_id: 1>,] ectect > > Now i want to store all the values of the "ticket_fees" in a new > array. > > like this... > > ticket_fee = ["2", "3", "1"] > > How can i do this(newbie) > > Thanks..remco > -- > Posted via http://www.ruby-forum.com/. > -- Florian Gilcher smtp: flo@andersground.net jabber: Skade@jabber.ccc.de gpg: 533148E2