I have an array of Active Record objects. I would like to create a hash that serves as an index. My Active Record objects have name
and properties value
.
Ideally, I would like to iterate over the array and create a hash that will create something similar to:
hash[name] = value
What is the best way to create an array foo
to create a hash similar to the one above?
source
share