I’m using will_paginate in my rails project and I get this behavior, the current page number, is outside of the numbers. Here is an image.

And here is the html code generated by will_paginate
<div style="text-align:center;">
<div class="pagination">
<a class="previous_page" rel="prev start" href="/offers?page=1">← Previous</a>
<a rel="prev start" href="/offers?page=1">1</a>
<em class="current">2</em>
<span class="next_page disabled">Next →</span>
</div>
</div>
Does anyone can help me with this issues, please???
Rails code:
def index
@offers = Offer.paginate(:page => params[:page], :per_page => 7).order('created_at DESC')
end
If you’re using bootstrap, check out this gem:
https://github.com/yrgoldteeth/bootstrap-will_paginate
The markup from
will_paginateis a bit different from the bootstrap one – this gem adjusts it to work with bootstrap.