View Source ExTeal.Fields.HasMany (ExTeal v0.27.0)
The HasMany
field corresponds to a has_many
ecto relationship. For example,
let's assume a User
schema has many Post
schema. We may add the relationship
to our User
ExTeal resource like so:
alias ExTeal.Fields.HasMany
HasMany.make(:posts)
Summary
Functions
Callback implementation for ExTeal.Field.apply_options_for/4
.
Callback implementation for ExTeal.Field.default_sortable/0
.
Callback implementation for ExTeal.Field.filterable_as/0
.
Callback implementation for ExTeal.Field.make/2
.
Callback implementation for ExTeal.Field.sanitize_as/0
.
Callback implementation for ExTeal.Field.value_for/3
.
Define a list of custom index fields to use when displaying the has many relationship.
Functions
Callback implementation for ExTeal.Field.apply_options_for/4
.
Callback implementation for ExTeal.Field.default_sortable/0
.
Callback implementation for ExTeal.Field.filterable_as/0
.
Callback implementation for ExTeal.Field.make/2
.
Callback implementation for ExTeal.Field.sanitize_as/0
.
Callback implementation for ExTeal.Field.value_for/3
.
@spec with_index_fields(ExTeal.Field.t(), [ExTeal.Field.t()]) :: ExTeal.Field.t()
Define a list of custom index fields to use when displaying the has many relationship.
HasMany.make(:posts)
|> HasMany.with_index_fields([
Text.make(:title)
])
This list of fields will override the fields used when displaying, sorting, and filtering the related table.