From: Rob Biedenharn Date: 2009-07-18T07:50:52+09:00 Subject: Re: Creation of Table Data From Rake On Jul 17, 2009, at 5:48 PM, Älphä Blüë wrote: > I added a simple loop at the very bottom of the pastie code which > shows > you all of the id and rating values for all 28 arrays (14 paired). I > did this to show that I do indeed have the data in rake. I just don't > know what to do with it now that I have it and how to save it in the > open model object.. > > -- > Posted via http://www.ruby-forum.com/. > I just posted this to your thread on the rails list, but I'll answer here, too. Put this at the end of your pastie and see if it helps you see. # referencing a new key causes an empty has to be stored as the value stats = Hash.new {|h,k| h[k] = {} } # i will take on the same values as 0.upto(119) 120.times do |i| stats[to_team_id[i]][:to] = to_ppcs[i] stats[ro_team_id[i]][:ro] = ro_ppcs[i] stats[po_team_id[i]][:po] = po_ppcs[i] stats[so_team_id[i]][:so] = so_ppcs[i] stats[rzo_team_id[i]][:rzo] = rzo_ppcs[i] stats[flo_team_id[i]][:flo] = flo_ppcs[i] stats[pio_team_id[i]][:pio] = pio_ppcs[i] stats[too_team_id[i]][:too] = too_ppcs[i] stats[sao_team_id[i]][:sao] = sao_ppcs[i] stats[tflo_team_id[i]][:tflo] = tflo_ppcs[i] stats[peo_team_id[i]][:peo] = peo_ppcs[i] stats[fdo_team_id[i]][:fdo] = fdo_ppcs[i] stats[tdco_team_id[i]][:tdco] = tdco_ppcs[i] stats[fdco_team_id[i]][:fdco] = fdco_ppcs[i] end puts stats.inspect # or this might be easier to read require 'pp' pp stats -Rob Rob Biedenharn http://agileconsultingllc.com Rob@AgileConsultingLLC.com