From 2dbc1753002b09322e8f36e8d997c70c791699a0 Mon Sep 17 00:00:00 2001 From: Petr Kachanovsky Date: Wed, 22 Jan 2025 15:29:33 +0200 Subject: [PATCH] docs: fill foreign resources section --- .../13-standardPagesTuning.md | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/adminforth/documentation/docs/tutorial/03-Customization/13-standardPagesTuning.md b/adminforth/documentation/docs/tutorial/03-Customization/13-standardPagesTuning.md index e84c86370..f0ca34755 100644 --- a/adminforth/documentation/docs/tutorial/03-Customization/13-standardPagesTuning.md +++ b/adminforth/documentation/docs/tutorial/03-Customization/13-standardPagesTuning.md @@ -450,4 +450,23 @@ Note: array columns can not be marked as `masked`, be a `primaryKey` and at the ### Foreign resources -[Documentation in progress] +When you want to create a connection between two resources, you need to add `foreignResource` to a column, like so: + +```typescript title="./resources/users.ts" +export default { + name: 'users', + columns: [ + ... + { + name: "realtor_id", + foreignResource: { + resourceId: 'users', + }, + }, + ], + }, + ... + ], +``` + +This way, when creating or editing a record you will be able to choose value for this field from a dropdown selector and on list and show pages this field will be displayed as a link to a foreign resource. \ No newline at end of file