Comments (8)
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
from will_paginate-bootstrap.
If I haven't understood correctly, feel free to re-open!
from will_paginate-bootstrap.
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 %> EOHTMLget "/" 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.
from will_paginate-bootstrap.
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.8381On 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 %> EOHTMLget "/" 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.
from will_paginate-bootstrap.
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?
from will_paginate-bootstrap.
@poombavai I have this problem too. Did you solve it?
from will_paginate-bootstrap.
@zhukovRoman No. Not yet. Tried pagination with Kaminari gem.
from will_paginate-bootstrap.
@zhukovRoman No. Not yet. Tried pagination with Kaminari gem.
from will_paginate-bootstrap.
Related Issues (20)
- License missing from gemspec HOT 2
- Is it possible to remove the default class of `.pagination`? HOT 6
- Responsive pagination HOT 1
- Move to central organisation? HOT 13
- Pagination class on div not ul HOT 2
- Mongoid Support HOT 2
- Anyway to change the size of the pagination? HOT 1
- Error: Uninitialized Constant HOT 2
- Supporting Screen Readers HOT 1
- Add padrino support HOT 2
- Is there a plan to add a drop-down for results per page next to the page selection section?
- Class pagination on div rather than ul HOT 1
- Using more bootstrap pagination classes HOT 1
- i18n support? HOT 2
- Size control? HOT 1
- Bootstrap 4 support? HOT 3
- Limiting number of pages in links using will_paginate HOT 1
- Ruby 2.4 Deprecation Warnings
- Mathjax content not rendering HOT 1
- Deprecated Fixnum on Ruby v2.4.0+ HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from will_paginate-bootstrap.