I am using will_pagination with ruby 1.8.7 and rails 2.3.8 and getting pagination link like,
<< previous 1 2 3 4 5 6 7 8 9 ... 66 67 next >> and
<< previous 1 2 ... 30 31 32 33 34 35 36 37 38 39 ... 66 67 next >>
Help me how to present pagination link like below,
<< previous 1 2 3 4 5 ... 66 67 next >> (or)
<< previous 1 2 ... 30 31 ... 66 67 next >>
Want to customize page links, here i like bring gap css after page 5 instead of page 9. Is this possible?
You can write your own
LinkRendererand pass it as therendereroption:Have a look at LinkRendererBase and LinkRenderer to see how the default renderer works.
Update: Actually you don’t need to create your own renderer to achieve what you want. Customize WillPaginate like:
And it will render the pagination bar like the way you want it to. You can add the initialization to an initializer file in the
config/initializersfolder.