View Source ExTeal.Fields.BelongsTo (ExTeal v0.27.7)

The BelongsTo field corresponds to a belongs_to ecto relationship. For example, let's assume a Post schema belongs_to a User schema. We may add the relationship to our Post ExTeal resource like so:

alias ExTeal.Fields.BelongsTo

BelongsTo.make(:user)

Summary

Functions

Callback implementation for ExTeal.Field.make/2.

Callback implementation for ExTeal.Field.sanitize_as/0.

Mark a Belongs To Field as searchable, allowing the UX to search the related resource for matches in the create and update forms

Functions

Callback implementation for ExTeal.Field.default_sortable/0.

Link to this function

make(name, label \\ nil)

View Source

Callback implementation for ExTeal.Field.make/2.

Callback implementation for ExTeal.Field.sanitize_as/0.

@spec searchable(ExTeal.Field.t()) :: ExTeal.Field.t()

Mark a Belongs To Field as searchable, allowing the UX to search the related resource for matches in the create and update forms