Add API to boards

This commit is contained in:
David Heinemeier Hansson
2025-12-01 14:01:34 +01:00
committed by Stanko K.R.
parent 728fe7c243
commit ea697b7143
4 changed files with 8 additions and 1 deletions
+5 -1
View File
@@ -1,9 +1,13 @@
class BoardsController < ApplicationController
include FilterScoped
before_action :set_board, except: %i[ new create ]
before_action :set_board, except: %i[ index new create ]
before_action :ensure_permission_to_admin_board, only: %i[ update destroy ]
def index
@boards = Current.user.boards
end
def show
if @filter.used?(ignore_boards: true)
show_filtered_cards
+1
View File
@@ -1,6 +1,7 @@
json.cache! board do
json.(board, :id, :name, :all_access)
json.created_at board.created_at.utc
json.url board_url(board)
json.creator do
json.partial! "users/user", user: board.creator
+1
View File
@@ -0,0 +1 @@
json.array! @boards, partial: "boards/board", as: :board
+1
View File
@@ -0,0 +1 @@
json.partial! "boards/board", board: @board