rails: style will_paginate with bootstrap links

4.9k views Asked by At

I have a bootstrap style on my will_paginate that i would like to customize!:

image of my pagination links

As you can see on my image, I would like to hide the number of page to only show the previous and next label.

I succeeded to custom the icon of next and previous label like this: in config/locales/en.yml:

  will_paginate:
    previous_label: <i class="fa fa-angle-left" style="color:black"></i>
    next_label: <i class="fa fa-angle-right" style="color:black"></i>

But I am really stuck on the process to hide this labels. Any ideas?

1

There are 1 answers

0
cschroed On

In your view, try the page_links option:

<%= will_paginate @your_objects, page_links: false %>

For more info see the API documentation for view template helpers.