Add pagination to most places and fix cards pagination

This commit is contained in:
Stanko K.R.
2025-12-09 12:43:45 +01:00
parent eb787fb590
commit f3ff0c605e
8 changed files with 7 additions and 9 deletions
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -1 +1 @@
json.array! @boards, partial: "boards/board", as: :board
json.array! @page.records, partial: "boards/board", as: :board
-2
View File
@@ -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?
+1 -1
View File
@@ -1 +1 @@
json.array! @tags, partial: "tags/tag", as: :tag
json.array! @page.records, partial: "tags/tag", as: :tag
+1 -1
View File
@@ -1 +1 @@
json.array! @users, partial: "users/user", as: :user
json.array! @page.records, partial: "users/user", as: :user
+1 -1
View File
@@ -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