you're right, rather than pushing hash into tags_on , I'll have to build it as a straight hash
On 24 fév, 22:09, Colin Law <[email protected]> wrote: > On 24 February 2011 18:29, Erwin <[email protected]> wrote: > > > 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 ? > > Assuming the keys are unique why don't you build it as a straight hash > in the first place? If they are not unique then you are in trouble > anyway. If you are stuck with the array then I think I would use > collect to convert it into a straight hash first. > > Colin -- 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

