diff --git a/app/controllers/boards_controller.rb b/app/controllers/boards_controller.rb index ae2f59a88..0214f9ce6 100644 --- a/app/controllers/boards_controller.rb +++ b/app/controllers/boards_controller.rb @@ -5,7 +5,7 @@ class BoardsController < ApplicationController before_action :ensure_permission_to_admin_board, only: %i[ update destroy ] def index - @boards = Current.user.boards + set_page_and_extract_portion_from Current.user.boards end def show diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index 2dc468f0d..6b72fdf50 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -1,5 +1,5 @@ class TagsController < ApplicationController def index - @tags = Current.account.tags.all.alphabetically + set_page_and_extract_portion_from Current.account.tags.alphabetically end end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 53547f901..11bd28b7a 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -3,7 +3,7 @@ class UsersController < ApplicationController before_action :ensure_permission_to_change_user, only: %i[ update destroy ] def index - @users = Current.account.users.active.alphabetically + set_page_and_extract_portion_from Current.account.users.active.alphabetically end def show diff --git a/app/views/boards/index.json.jbuilder b/app/views/boards/index.json.jbuilder index fe042c91c..047401cff 100644 --- a/app/views/boards/index.json.jbuilder +++ b/app/views/boards/index.json.jbuilder @@ -1 +1 @@ -json.array! @boards, partial: "boards/board", as: :board +json.array! @page.records, partial: "boards/board", as: :board diff --git a/app/views/cards/index.json.jbuilder b/app/views/cards/index.json.jbuilder index f3f204632..c1dc1dff1 100644 --- a/app/views/cards/index.json.jbuilder +++ b/app/views/cards/index.json.jbuilder @@ -1,3 +1 @@ json.array! @page.records, partial: "cards/card", as: :card - -json.next_page_url cards_path(@board, page: @page.next_param) unless @page.last? diff --git a/app/views/tags/index.json.jbuilder b/app/views/tags/index.json.jbuilder index 03e8857d4..58fa7f00f 100644 --- a/app/views/tags/index.json.jbuilder +++ b/app/views/tags/index.json.jbuilder @@ -1 +1 @@ -json.array! @tags, partial: "tags/tag", as: :tag +json.array! @page.records, partial: "tags/tag", as: :tag diff --git a/app/views/users/index.json.jbuilder b/app/views/users/index.json.jbuilder index 98788dadd..2472a7b47 100644 --- a/app/views/users/index.json.jbuilder +++ b/app/views/users/index.json.jbuilder @@ -1 +1 @@ -json.array! @users, partial: "users/user", as: :user +json.array! @page.records, partial: "users/user", as: :user diff --git a/test/controllers/tags_controller_test.rb b/test/controllers/tags_controller_test.rb index e3685e60b..d99939c60 100644 --- a/test/controllers/tags_controller_test.rb +++ b/test/controllers/tags_controller_test.rb @@ -6,7 +6,7 @@ class TagsControllerTest < ActionDispatch::IntegrationTest end test "index as JSON" do - tags = users(:kevin).account.tags.all.alphabetically + tags = users(:kevin).account.tags.alphabetically get tags_path, as: :json assert_response :success