Closed anu-vaid closed 12 years ago
A "gap" element should be displayed if there are enough items in the pagination collection. Here's a really simple example which demonstrates this using Sinatra:
require "sinatra"
require "will_paginate-bootstrap"
require "will_paginate/collection"
$template = <<EOHTML
<html>
<head>
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/css/bootstrap-combined.min.css" rel="stylesheet">
</head>
<body>
<%= will_paginate @collection, :renderer => BootstrapPagination::Sinatra %>
</body>
</html>
EOHTML
get "/" do
@collection = WillPaginate::Collection.new 1, 10, 100000
erb $template
end
If you put that in a file and run it (with sinatra and will_paginate-bootstrap gems installed) - you'll see a gap.
There are also various will_paginate options you can tweak to control when the gap gets displayed: https://github.com/mislav/will_paginate/blob/master/lib/will_paginate/view_helpers.rb
If I haven't understood correctly, feel free to re-open!
Thank you so much for the quick response. Still trying to figure out how to do it in Rails app. I have
<%= will_paginate @products, :renderer => BootstrapPagination::Rails %>
and in my model I have
self.per_page = 10
in the controller
@products = @company. products.page(params[:page])
I know I am missing something. I tried
<%= will_paginate @feeds, :renderer => BootstrapPagination::Rails, :inner_window => 4, :outer_window => 1 %>
but that did not help.
Anupama Vaid www.parentsquare.com 805.637.8381
On Sep 17, 2012, at 9:50 AM, Nick Dainty wrote:
A "gap" element should be displayed if there are enough items in the pagination collection. Here's a really simple example which demonstrates this using Sinatra:
require "sinatra" require "will_paginate-bootstrap" require "will_paginate/collection"
$template = <<EOHTML
<%= will_paginate @collection, :renderer => BootstrapPagination::Sinatra %>EOHTML
get "/" do @collection = WillPaginate::Collection.new 1, 10, 100000 erb $template end If you put that in a file and run it (with sinatra and will_paginate-bootstrap gems installed) - you'll see a gap.
There are also various will_paginate options you can tweak to control when the gap gets displayed: https://github.com/mislav/will_paginate/blob/master/lib/will_paginate/view_helpers.rb
— Reply to this email directly or view it on GitHub.
Nevermind - It comes up when there are too many records.
Sorry about the post.
Thanks, Anu
Anupama Vaid www.parentsquare.com 805.637.8381
On Sep 17, 2012, at 10:12 AM, Anupama Vaid wrote:
Thank you so much for the quick response. Still trying to figure out how to do it in Rails app. I have
<%= will_paginate @products, :renderer => BootstrapPagination::Rails %>
and in my model I have
self.per_page = 10
in the controller
@products = @company. products.page(params[:page])
I know I am missing something. I tried
<%= will_paginate @feeds, :renderer => BootstrapPagination::Rails, :inner_window => 4, :outer_window => 1 %>
but that did not help.
Anupama Vaid www.parentsquare.com 805.637.8381
On Sep 17, 2012, at 9:50 AM, Nick Dainty wrote:
A "gap" element should be displayed if there are enough items in the pagination collection. Here's a really simple example which demonstrates this using Sinatra:
require "sinatra" require "will_paginate-bootstrap" require "will_paginate/collection"
$template = <<EOHTML
<%= will_paginate @collection, :renderer => BootstrapPagination::Sinatra %>EOHTML
get "/" do @collection = WillPaginate::Collection.new 1, 10, 100000 erb $template end If you put that in a file and run it (with sinatra and will_paginate-bootstrap gems installed) - you'll see a gap.
There are also various will_paginate options you can tweak to control when the gap gets displayed: https://github.com/mislav/will_paginate/blob/master/lib/will_paginate/view_helpers.rb
— Reply to this email directly or view it on GitHub.
Hi.. inner_window and outer_window doesnot showing me any changes in my page.. I have tried like,
my views,
<%= will_paginate @issue, page_links: true, inner_window: 2, outer_window: 1 %>
my controller,
@issue = Issue.all.paginate(page: params[:page], per_page: 5).order("issue_slip_no DESC")
..
How should I correct it?
@poombavai I have this problem too. Did you solve it?
@zhukovRoman No. Not yet. Tried pagination with Kaminari gem.
@zhukovRoman No. Not yet. Tried pagination with Kaminari gem.
Is there a way to introduce a disabled gap in the middle if there are many pages?