Database outputting results twice per page (using pagination

Each page is getting the same 5 db results listed twice, I cant seem
to figure out why

this is how the page look
page 1:
post 1
post 2
post 3
post 1
post 2
post 3

page 2:
post 4
post 5
post 6
post 4
post 5
post 6

template

<%= render_collection_of_partials “upcoming”, @albums_pages %>

view (sorry its big)

<% @upcoming.each do |i| %>

< %= image_tag url_for_file_column(i, "cover"), :id => 'cover' %>

<% @title = i.artist + " - " + i.album %><%= link_to @title, albums_url(:permalink => i.permalink) %>

[<%= i.genre %>] / released: <%= i.date %><%= i.info %>
Hype ( +45 ) or Drop ( -7 )


<% end %>

Controller

def upcoming

@total = Albums.count

@sorter = SortingHelper::Sorter.new self, %w(artist album date),
@params[‘sort’], @params[‘order’], ‘date’, ‘ASC’
@albums_pages = Paginator.new self, Albums.count, 5, @params[‘page’]
@upcoming = Albums.find_all nil, @sorter.to_sql,
@albums_pages.current.to_sql

render :layout => ‘albums_upcoming’

end

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs