0

There's already a lot on this already (here) but I can't seem to find anything that works. I simply want to limit the number of posts that are returned. I thought:

Post.order("created_at desc").limit(6).page(params[:page]).per_page(3)

would work but unfortunately not. I then tried:

Post.order("created_at desc").page(params[:page]).per_page(3).total_entries(6)

but that gives me a wrong number of arguments (1 for 0) error.

Community
  • 1
  • 1

0 Answers0