#

# Options Hierarchy


Pagy has a top-down hierarchical options system that allows you to set and override options at different levels.

# Global level

  • For example Pagy.options[:limit] = 10.
  • Set in the pagy.rb initializer.
  • The Pagy.options are inherited by all paginators and helpers.
  • You can set all kinds of options at the global level, no matter which is the destination downstream (i.e., paginator or helper).

# Paginator level

  • For example pagy(paginator, collection, **options).
  • The options passed to a paginator override the Pagy.options set upstream for that instance.

# Helper level

  • For example @pagy.series_nav(**options).
  • The options passed to a helper override the options set upstream at any level for the helper output.
  • Otions already consumed upstream are not affected.