Skip to content
How-to guides and worked examplesSee the guides →

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:

ruby
field :avatar, as: :avatar

Field-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 ​

BehaviorDefault
VisibilityIndex-only. See the shared only_on visibility option.
Column headingBlank unless the shared name option is supplied.
Image presentationSmall, 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 contentRendered result
Resource avatar source returns a nonblank valueAvatar image.
Image source is missing or blank, and the record has initialsInitials derived from the record title: the first letters of its words, limited to two characters and uppercased.
Neither an image nor initials are availableEmpty 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.