sscirrus
sscirrus

Reputation: 56749

Using custom names with will_paginate

I'm using Mislav's will_paginate and I want to use the render option as shown in the repository's docs:

<%= page_entries_info @posts %>  #-> Displaying posts 6 - 10 of 26 in total

My particular model is named CoPosts, which is not as friendly as Post. I would love to use their render option but I would like to change Displaying co_posts 6-10 to Displaying posts 6-10...

How can I change the name will_paginate uses for its rendering?

Upvotes: 3

Views: 587

Answers (1)

samullen
samullen

Reputation: 2530

I believe you want to do something like this:

<%= page_entries_info @co_posts, :entry_name => 'post' %>

You can find more information on what options are available on the ViewHelpers rdoc page.

An alternative to will_paginate which you might also consider is Kaminari. It was recently covered in RailsCast 254

Good luck with your project.

Upvotes: 2

Related Questions