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

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -