Subscribe to RSS Feed
Twitter
HIRE ME! home  archives  about  blogroll

Distinct and will_paginate

18 Mar 2009

Combinatie van MySQL met distinct en de rails will_paginate plugin werkt niet vanzelf blijkbaar.

Hoe dan wel?

Article.paginate(
	:all, 
	:page => params[:page], 
	:per_page => 5, 
	:count => {:select => "articles.id"}, 
	:select => "distinct articles.id, articles.*"))
blog comments powered by Disqus