Vitalii Prodan
Vitalii Prodan

Reputation: 175

rails 4 will_paginate set count of links on pages

I'm using rails 4 and gem will_paginate. I can't customize count of links on pages before gap (...). eg now I having 9 pages than ellipsis and 3 last pages. How can I set 5 pages instead 9 (see scrennshots)? In controller:

 @per_page = params[:per_page] || 6
 @events = Event.not_cancelled.paginate(:page => params[:page], :per_page => @per_page)

Now

enter image description here

That I want

enter image description here

Upvotes: 0

Views: 356

Answers (1)

dieuhd
dieuhd

Reputation: 1326

You must change value for inner_window. Reference here.

So here is code:

<%= will_paginate @events, :inner_window => 2, :outer_window => 1 %>

Upvotes: 5

Related Questions