Pregunta

I'd like to order my post results by page. Kind of like what they have on active admin... or every other website in the universe. I'm running Rails 3.2.1

For example with Active Admin you click on something like this:

http://website.com/admin/users?order=id_desc&page=2

And you have a certain number of posts on page two... then another set on page 3... etc.

I'm just wondering how to do that with a standard posts page in rails so that every page has like 10 posts.

¿Fue útil?

Solución

You definitely want to use the will_apginate gem https://github.com/mislav/will_paginate

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top