Thursday, February 24, 2011

[Rails] Array and Hash ... how to find the value ? DRYest way

I have an array of hash :
tags_on
=> [{:point=>["a", "b", "c"]}, {:comma=>["d", "e"]}]

and I would like to get the value ["d", "e"] for a specified
key :comma
is there any DRY way to do it or should I loop into the array ?

thanks for your feedback

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate