View Source ExTeal.Fields.HasOne (ExTeal v0.27.0)

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

alias ExTeal.Fields.HasOne

HasOne.make(:permalink)

Title Attributes

When a HasOne field is shown on an associated BelongsTo resources index/detail screen, the associated row will have a link to the HasOne and will display the "title" of the resource. For example, a permalink resource may display the address attribute as it's title. Then, when the resource is shown as an association on the belongs_to index or detail views, that attribute will be displayed, supported attributes are name, title, or address.

Summary

Functions