Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Total count #29

Closed
blackpond opened this issue Feb 23, 2011 · 2 comments
Closed

Total count #29

blackpond opened this issue Feb 23, 2011 · 2 comments

Comments

@blackpond
Copy link

How can I show the total count of the found set. So if I have 900 customers, showing 100 per page, I would like to show "100 of 900 Customers" Thanks!

@amatsuda
Copy link
Member

Sorry for the poor documentation, but you can use total_count method for the total count (as you might have expected).

  • "100 of 900 Customers"

<%= @customers.length %> of <%= @customers.total_count %> Customers

  • "1 - 100 of 900 " (GMailish style)

<%= @customers.offset_value + 1 %> - <%= @customers.offset_value + @customers.length %> of <%= @customers.total_count %>

@blackpond
Copy link
Author

Awesome! Thanks! Love the gem!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants