Loop a ruby hash -
I need a loop for a hash like this:
h {"identifier "= & Gt; ["1", "2"], "name" = & gt; ["Name 1", name 2 "]} This hash has been posted with a form and should be enclosed with the record, the identifier" 1 "is named" name1 "whith. < / P>
So how do I loop for this hash?
Try it: < / P> [: h] [: identifier] .each_with_index {| key, value | person = person.fid (key) .update (name: param [: h] [: name] [ Value])}
Comments
Post a Comment