ruby-on-railsrubypaginationwill-paginate

Will Paginate: Limit number of results


Im using the will paginate gem for ruby. I am using will paginate to get a bunch of people and sorting on a field. What I want is only the first 100 of those. Essentially the top people. I cant seeem to do this. How would i go about it? Thanks


Solution

  • people = Person.limit(100).paginate(:per_page => 5)