Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow using a custom page param with pagination #1039

Open
paulcsmith opened this issue Mar 12, 2020 · 1 comment
Open

Allow using a custom page param with pagination #1039

paulcsmith opened this issue Mar 12, 2020 · 1 comment
Labels
feature request A new requested feature / option usability Features that improve framework usability

Comments

@paulcsmith
Copy link
Member

paulcsmith commented Mar 12, 2020

Do this after #1020

  # The name of the param that Lucky will use for the current page. Defaults to `:page`.
  #
  # You can override this method to use a different page param. This is rarely
  # overridden, but you can if you need to.
  #
  # ## Example
  #
  # ```crystal
  # abstract class BrowserAction < Lucky::Action
  #   include Lucky::Paginator::BackendHelpers
  #
  #   def paginator_page_param : Symbol
  #     :my_custom_page_param
  #   end
  # end
  # ```
  def paginator_page_param : Symbol
    :page
  end

And also add an arg to Paginator so it can use the param when generating links!

@wout
Copy link
Contributor

wout commented Mar 29, 2020

Could be very useful. Sometimes you might want to use :p instead for :page, just like using q instead of query.

@stephendolan stephendolan added feature request A new requested feature / option usability Features that improve framework usability labels Oct 22, 2020
@stephendolan stephendolan added this to To do in Lucky 1.0 Oct 22, 2020
@stephendolan stephendolan added this to To Do in Lucky 1.0 Oct 22, 2020
@stephendolan stephendolan removed this from To do in Lucky 1.0 Oct 22, 2020
@stephendolan stephendolan removed this from To Do in Lucky 1.0 Jul 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request A new requested feature / option usability Features that improve framework usability
Projects
Lucky Future
Awaiting triage
Development

No branches or pull requests

3 participants