Skip to content

Commit

Permalink
Update pagination to use params[:_page] per administrate's changes (#39)
Browse files Browse the repository at this point in the history
See thoughtbot/administrate#1725

Relevant excerpt:

> Using the param :page for top-level pagination (ie: index pages as opposed to has_many lists in show pages) conflicts with paginating resources whose type happens to be "Page".
  • Loading branch information
harley authored May 17, 2021
1 parent c5cead9 commit 43814ab
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
Empty file modified bin/setup
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion lib/administrate/base_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def index
resources = index_resources
resources = apply_collection_includes(resources)
resources = order.apply(resources)
resources = resources.page(params[:page]).per(records_per_page)
resources = resources.page(params[:_page]).per(records_per_page)

respond_to do |format|
format.json { render_index_json(resources) }
Expand Down

0 comments on commit 43814ab

Please sign in to comment.