Skip to content

Commit ee1ed56

Browse files
AstaldosPetr Kachanovsky
andauthored
docs: fill foreign resources section (#83)
Co-authored-by: Petr Kachanovsky <[email protected]>
1 parent 7b8637e commit ee1ed56

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

adminforth/documentation/docs/tutorial/03-Customization/13-standardPagesTuning.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,4 +450,23 @@ Note: array columns can not be marked as `masked`, be a `primaryKey` and at the
450450

451451
### Foreign resources
452452

453-
[Documentation in progress]
453+
When you want to create a connection between two resources, you need to add `foreignResource` to a column, like so:
454+
455+
```typescript title="./resources/users.ts"
456+
export default {
457+
name: 'users',
458+
columns: [
459+
...
460+
{
461+
name: "realtor_id",
462+
foreignResource: {
463+
resourceId: 'users',
464+
},
465+
},
466+
],
467+
},
468+
...
469+
],
470+
```
471+
472+
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.

0 commit comments

Comments
 (0)