liftedmedia-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-May-19 03:19 UTC
database outputting results twice per page (using pagination + sorthelper)
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| %> <div id="album"> <div id="info"><a href="<%= albums_url(:permalink => i.permalink) %>">< %= image_tag url_for_file_column(i, "cover"), :id => ''cover'' %> </a><br> <h2><% @title = i.artist + " - " + i.album %><a href="albumview.htm"><%= link_to @title, albums_url(:permalink => i.permalink) %></a></h2> <span id="subbar">[<%= i.genre %>] / released: <%= i.date %></ span><%= i.info %><br> <span id="subtext"><a href="#">Hype</a> ( +45 ) or <a href="#">Drop</a> ( -7 ) <span id="subtext"> </span></span> </div></ div><br><br> <% 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 --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---