Sha256: 0b4af973b3d2f701e281762f014a40edf90efa809459fe1207dc8ed4e39f93d8

Contents?: true

Size: 871 Bytes

Versions: 30

Compression:

Stored size: 871 Bytes

Contents

# frozen_string_literal: true

module Decidim
  # Helper to paginate collections.
  module PaginateHelper
    # Displays pagination links for the given collection, setting the correct
    # theme. This mostly acts as a proxy for the underlying pagination engine.
    #
    # collection - a collection of elements that need to be paginated
    # paginate_params - a Hash with options to delegate to the pagination helper.
    def decidim_paginate(collection, paginate_params = {})
      # Kaminari uses url_for to generate the url, but this doesn't play nice with our engine system
      # and unless we remove these params they are added again as query string :(
      default_params = {
        participatory_process_id: nil,
        component_id: nil
      }

      paginate collection, theme: "decidim", params: paginate_params.merge(default_params)
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
decidim-core-0.22.0 app/helpers/decidim/paginate_helper.rb
decidim-core-0.21.0 app/helpers/decidim/paginate_helper.rb
decidim-core-0.20.1 app/helpers/decidim/paginate_helper.rb
decidim-core-0.20.0 app/helpers/decidim/paginate_helper.rb
decidim-core-0.19.1 app/helpers/decidim/paginate_helper.rb
decidim-core-0.18.1 app/helpers/decidim/paginate_helper.rb
decidim-core-0.19.0 app/helpers/decidim/paginate_helper.rb
decidim-core-0.17.2 app/helpers/decidim/paginate_helper.rb
decidim-core-0.18.0 app/helpers/decidim/paginate_helper.rb
decidim-core-0.17.1 app/helpers/decidim/paginate_helper.rb
decidim-core-0.16.1 app/helpers/decidim/paginate_helper.rb
decidim-core-0.17.0 app/helpers/decidim/paginate_helper.rb
decidim-core-0.16.0 app/helpers/decidim/paginate_helper.rb
decidim-core-0.15.2 app/helpers/decidim/paginate_helper.rb
decidim-core-0.15.1 app/helpers/decidim/paginate_helper.rb
decidim-core-0.15.0 app/helpers/decidim/paginate_helper.rb
decidim-core-0.14.4 app/helpers/decidim/paginate_helper.rb
decidim-core-0.14.3 app/helpers/decidim/paginate_helper.rb
decidim-core-0.14.2 app/helpers/decidim/paginate_helper.rb
decidim-core-0.14.1 app/helpers/decidim/paginate_helper.rb