show array size with will_paginate

Posted by chief on Stack Overflow See other posts from Stack Overflow or by chief
Published on 2010-04-01T02:33:17Z Indexed on 2010/04/01 3:13 UTC
Read the original article Hit count: 197

Filed under:
   @users = User.paginate(
                   :page => params[:page], :per_page => 2,  

I would like to return the total number of results. @users.size simply gives me the number of results on a page. If page 1 has 2 users @users.size = 2, going to page 2 with say 1 user @users.size = 1. How can I show the size of all the users?

© Stack Overflow or respective owner

Related posts about ruby-on-rails