-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathpagy.rb
More file actions
49 lines (39 loc) · 2.1 KB
/
pagy.rb
File metadata and controls
49 lines (39 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# frozen_string_literal: true
# Pagy initializer file (43.3.0)
# See https://ddnexus.github.io/pagy/resources/initializer/
############ Global Options ################################################################
# See https://ddnexus.github.io/pagy/toolbox/options/ for details.
# Add your global options below. They will be applied globally.
# For example:
#
Pagy::OPTIONS[:limit] = 20 # Limit the items per page
# Pagy::OPTIONS[:client_max_limit] = 100 # The client can request a limit up to 100
# Pagy::OPTIONS[:max_pages] = 200 # Allow only 200 pages
# Pagy::OPTIONS[:jsonapi] = true # Use JSON:API compliant URLs
Pagy::OPTIONS.freeze
############ JavaScript ####################################################################
# See https://ddnexus.github.io/pagy/resources/javascript/ for details.
# Examples for Rails:
# For apps with an assets pipeline
# Rails.application.config.assets.paths << Pagy::ROOT.join('javascripts')
#
# For apps with a javascript builder (e.g. esbuild, webpack, etc.)
# javascript_dir = Rails.root.join('app/javascript')
# Pagy.sync_javascript(javascript_dir, 'pagy.mjs') if Rails.env.development?
############# Overriding Pagy::I18n Lookup #################################################
# Refer to https://ddnexus.github.io/pagy/resources/i18n/ for details.
# Override the I18n lookup by dropping your custom dictionary in some pagy dir.
# Example for Rails:
#
# Pagy::I18n.pathnames << Rails.root.join('config/locales/pagy')
############# I18n Gem Translation #########################################################
# See https://ddnexus.github.io/pagy/resources/i18n/ for details.
#
Pagy.translate_with_the_slower_i18n_gem!
############# Calendar Localization for non-en locales ####################################
# See https://ddnexus.github.io/pagy/toolbox/paginators/calendar#localization for details.
# Add your desired locales to the list and uncomment the following line to enable them,
# regardless of whether you use the I18n gem for translations or not, whether with
# Rails or not.
#
# Pagy::Calendar.localize_with_rails_i18n_gem(*your_locales)