1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-04 15:24:23 +01:00
fab-manager/app/views/api/spaces/index.json.jbuilder
2023-08-24 14:41:29 +02:00

17 lines
334 B
Ruby

# frozen_string_literal: true
json.array!(@spaces) do |space|
json.partial! 'api/spaces/space', space: space
parent = @spaces_indexed_with_parent[space]
if parent
json.parent do
json.name parent.name
end
end
json.children @spaces_grouped_by_parent_id[space.id] do |child|
json.name child.name
end
end