Git Product home page Git Product logo

Comments (9)

CapyTheBeara avatar CapyTheBeara commented on May 15, 2024

Having the first page link contain the page param is also necessary when there are multiple things being paginated on a single page. +1 for implementing the above gist.

from kaminari.

pdeffendol avatar pdeffendol commented on May 15, 2024

Also, the instructions in the README under "Creating friendly URLs and caching" fail on page 2 due to the :page parameter being set to nil when creating a link to the previous page.

You can fix it in your routes like this:

resources :my_resources do
  get 'page/:page', :action => :index, :on => :collection, :defaults => {:page => 1}
end

from kaminari.

plribeiro3000 avatar plribeiro3000 commented on May 15, 2024

I think this is something that could be configurable but not the default behavior.

from kaminari.

yuki24 avatar yuki24 commented on May 15, 2024

@amatsuda @zzak could you take a look at https://github.com/yuki24/kaminari/compare/master...44-first-page-param? It adds skip_first_page_param config and I would like you to review the change.

from kaminari.

kreintjes avatar kreintjes commented on May 15, 2024

+1 for this change. I have a view which contains items with a datetime. When opening this view (without a page set), I would like to jump immediately to the page with the first item after the current time. This works fine, however, when going back to the first page, it again jumps (because the page param is not set) and displays a page somewhere in the middle. Personally I see no reason for not simply including the page param for the first page as well.

from kaminari.

sureseam avatar sureseam commented on May 15, 2024

+1 for this change also. Without it I will be obliged to "monkey patch" or switch away. There has been no reason not to release this change for ... quite a while.

from kaminari.

dmitry avatar dmitry commented on May 15, 2024

Please, merge it :neckbeard:

from kaminari.

cecomp64 avatar cecomp64 commented on May 15, 2024

+1 to merge in yuki24's change. I have my Gemspec pointing to his branch instead of the official release. Please update!

from kaminari.

dmitry avatar dmitry commented on May 15, 2024

I would add also this functionality, to make it possible to setup this option locally, not globally:
(https://github.com/amatsuda/kaminari/pull/543) https://github.com/amatsuda/kaminari/pull/543/files

from kaminari.

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.