-
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Yes. If all you want is to render the first and last pages in addition to the others, all the time, you can do this by changing the pagy = Pagy.new count: 1000, page: 10, size: [1, 4, 4,1] # etc
pagy.series
#=>[1, :gap, 6, 7, 8, 9, "10", 11, 12, 13, 14, :gap, 50]
# so you may want to do something like in your FoosController.rb
@pagy, @foos = pagy(Foo.all, size: [1, 4, 4, 1])
# or set a default in your pagy.rb initialiser if you want it globally set.
Pagy::DEFAULT[:size] = [1, 4, 4,1] Referencehttps://ddnexus.github.io/pagy/docs/how-to/#control-the-page-links and checkout the session on "classic nav". Try it out:Run the interactive demo from your terminal: bundle exec pagy demo and point your browser to (see pagy playground) Targeting ClassesLooks like you're using bootstrap (?) but for anyone else, who wants to target the first / last link via css.
Credit@ddnexus who suggested the references. |
Beta Was this translation helpful? Give feedback.
Yes.
If all you want is to render the first and last pages in addition to the others, all the time, you can do this by changing the
size
array:Reference
https://ddnexus.github.io/pagy/docs/how-to/#control-the-page-links and checkout the session on "cla…