I have the results of a search in an instance var called @results. Each item is an album. I have looped over the result set and added all the album parent collection id's to a var called @collections. This is done as below:
@results.each do |album|
@collections << album.collection_id
end
@collections = @collections.uniq
I now need to re iterate over the @results and create a child array of each album id that belongs in each collection.
I will then be able to use this to build nice output in my view.
I am rather confused as to how to build that child array of album id's per collection id.
Any help on this?