module PaginationHelper include Pagy::Frontend # change the default link renderer for will_paginate def will_paginate(collection_or_options = nil, options = {}) if collection_or_options.is_a? Hash options = collection_or_options collection_or_options = nil end options = options.merge renderer: PaginationListLinkRenderer unless options[:renderer] super(*[collection_or_options, options].compact) end # Cf https://github.com/ddnexus/pagy/blob/master/gem/lib/pagy/frontend.rb # i18n-tasks-use t("pagy.prev") # i18n-tasks-use t("pagy.next") # i18n-tasks-use t("pagy.aria_label.nav") def pagy_nav(pagy, id: nil, aria_label: nil, **vars) return nil unless pagy # Keep will_paginate behavior of showing nothing if only one page return nil if pagy.series.length <= 1 id = %( id="#{id}") if id a = pagy_anchor(pagy, **vars) html = %(