I know this probably has been asked before (In fact, I’m pretty sure of it).
Suppose I have a model Article, and want to find all articles that fit a certain condition, ordered by date.
Article.find(:conditions => [SOME CONDITION], :order => "date asc")
if I want to get the 10th to 20th rows from this query, how do I do so with ActiveRecord?
I am using Postgres, if it makes any difference.
The Rails 3 notation for this would be:
What you probably want is a pagination tool like Paginator or something similar. It will provide an interface to show page N instead of having to do the limit and offset calculations yourself.