From: "Abinoam Jr." Date: 2011-01-18T08:28:39+09:00 Subject: Re: Add value inside 'Nested Mappings String' Perhaps you're not considering that "children" returns an Array! The Hash inside it is the 0 indexed element of this Array. a = {"System"=>  {"H&S"=>    {"name"=>"Health & Safety",     "components"=>["FlashWheel"],     "children"=>      [{"name"=>"Training and Culture",        "type"=>"Programme",        "subtype"=>"None",        "components"=>"None"}]}}} a["System"]["H&S"]["children"][0]["name"]="Objective" now 'a' returns {"System"=>{"H&S"=>{"name"=>"Health & Safety", "components"=>["FlashWheel"], "children"=>[{"name"=>"Objective", "components"=>"None", "subtype"=>"None", "type"=>"Programme"}]}}} Abinoam Jr. On Mon, Jan 17, 2011 at 7: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/. > >