[code] ticket_fee = []find(:all).map{|record| ticket_fee << record.ticket_fees} [/code]
Try it:) btw, find(:all) you can write: 'all': Ticket.find(:all) #=> Ticket.all On Thu, Feb 26, 2009 at 5:17 PM, Remco Swoany < rails-mailing-l...@andreas-s.net> wrote: > > Hi, > > the array below is the output from a find(:all) > > [#<Boekingen affnr: "vl999", pnr: "MA5OSG", agent: "monties", > ticket_prijs: #<BigDecimal:b775f4c4,'0.138E3',4(12)>, aantal_pers: 2, > ticket_fees: nil, res_kosten: nil, commissie: nil, ticket_verz: nil, > tax: nil, total_prijs: #<BigDecimal:b775f230,'0.36316E3',8(12)>, 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: #<BigDecimal:b775ed08,'0.0',4(8)>, > annu_verz: #<BigDecimal:b775eccc,'0.0',4(8)>, 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/. > > > > -- TWRUG Blog: http://blog.rubyonrails.org.tw CFC on Rails: http://zusocfc.blogspot.com Only two surfaces of a box: http://blog.pixnet.net/zusocfc --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---