Avatar API
Reference for the Avatar field's declaration and display behavior. For setup examples, see the Avatar guide.
Declare the field inside the resource's fields method in app/avo/resources/user.rb:
field :avatar, as: :avatarField-specific options
The avatar field has no field-specific options. Inherited options are documented in the Field options API; task-oriented examples are in Shared field options.
Display defaults
| Behavior | Default |
|---|---|
| Visibility | Index-only. See the shared only_on visibility option. |
| Column heading | Blank unless the shared name option is supplied. |
| Image presentation | Small, square avatar. Size and shape are fixed, not field options. |
The field has an index renderer; it is not an image upload control.
Image source and fallbacks
The field displays the resource avatar configured through self.avatar, not the value selected by the field identifier. The resource-level source setting determines the image. It is not an option passed to field.
| Available content | Rendered result |
|---|---|
| Resource avatar source returns a nonblank value | Avatar image. |
| Image source is missing or blank, and the record has initials | Initials derived from the record title: the first letters of its words, limited to two characters and uppercased. |
| Neither an image nor initials are available | Empty avatar placeholder. |
The avatar column reads the resource's image source independently of the resource avatar's visible_on setting. That setting controls resource-level avatar placement, not the visibility of this field's index column.