From: Josh Cheek Date: 2011-01-18T09:17:47+09:00 Subject: Re: Add value inside 'Nested Mappings String' --001485f85a1a5760d5049a13cf7d Content-Type: text/plain; charset=ISO-8859-1 On Mon, Jan 17, 2011 at 4:59 PM, Kamarulnizam Rahim wrote: > Hi, > > Im trying to add some data/value into my nested mapping file(strings) > output but its not working. Below the example of my output: > > {"System"=> > {"H&S"=> > {"name"=>"Health & Safety", > "components"=>["FlashWheel"], > "children"=> > [{"name"=>"Training and Culture", > "type"=>"Programme", > "subtype"=>"None", > "components"=>.................. > > For example how can i change the children name from "Training and > Culture" to let say "Objective"? Do i need to build a new hash for this > data and modify that hash? Thanks in advance. > > Nizam > > -- > Posted via http://www.ruby-forum.com/. > > I think working with this data will quickly become very difficult to deal with. For an example, see the latest Peepcode ( http://peepcode.com/products/play-by-play-bernhardt) where they spend half the screencast trying to figure out what their data looks like (its all nested Hashes and Arrays, like yours). I think you should turn your data into instances of some class[es] that defines how to deal with these relationships in in a humane way. --001485f85a1a5760d5049a13cf7d--