I have an array I’m trying to output with partials. The query find
entries in the database correctly but the results are getting
outputted repeatedly.
For example, if there are 3 results from the query it would display
the 3 partials 3 times, if it was 4 it would repeat 4 times etc. Heres
what it would look like if "@albums = Album.find(@albumids) " found 3
ID’s
First Partial (id=1)
Second Partial (id=2)
Third Partial (id=3)
First Partial (id=1)
Second Partial (id=2)
Third Partial (id=3)
First Partial (id=1)
Second Partial (id=2)
Third Partial (id=3)
Heres the array and query
@activity = Activity.count( :group => 'album_id',
:conditions => ['created_at >= ?',
@time],
:order => “count_all DESC”,
:limit => 5 )
@albumids = @activity.map { |a| a[0] }
@albums = Album.find(@albumids)
And partial line
<%= render :partial => “album”, :collection => @albums %>
Any thoughts?