Add pagination to most places and fix cards pagination
This commit is contained in:
@@ -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,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
|
||||
|
||||
@@ -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 @@
|
||||
json.array! @boards, partial: "boards/board", as: :board
|
||||
json.array! @page.records, partial: "boards/board", as: :board
|
||||
|
||||
@@ -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 @@
|
||||
json.array! @tags, partial: "tags/tag", as: :tag
|
||||
json.array! @page.records, partial: "tags/tag", as: :tag
|
||||
|
||||
@@ -1 +1 @@
|
||||
json.array! @users, partial: "users/user", as: :user
|
||||
json.array! @page.records, partial: "users/user", as: :user
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user