Giter VIP home page Giter VIP logo

Comments (8)

nickpad avatar nickpad commented on July 20, 2024

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.

nickpad avatar nickpad commented on July 20, 2024

If I haven't understood correctly, feel free to re-open!

from will_paginate-bootstrap.

anu-vaid avatar anu-vaid commented on July 20, 2024

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.

from will_paginate-bootstrap.

anu-vaid avatar anu-vaid commented on July 20, 2024

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.

from will_paginate-bootstrap.

poombavai avatar poombavai commented on July 20, 2024

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.

zhukovRoman avatar zhukovRoman commented on July 20, 2024

@poombavai I have this problem too. Did you solve it?

from will_paginate-bootstrap.

poombavai avatar poombavai commented on July 20, 2024

@zhukovRoman No. Not yet. Tried pagination with Kaminari gem.

from will_paginate-bootstrap.

poombavai avatar poombavai commented on July 20, 2024

@zhukovRoman No. Not yet. Tried pagination with Kaminari gem.

from will_paginate-bootstrap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.