External image API
Per-option reference for external_image fields. For tasks and examples, see the External image guide.
Pass options to the field declaration in a resource's fields method in app/avo/resources/company.rb:
field :logo, as: :external_image, height: 80See also common field options.
Image sizing
width, height, and radius accept static values or procs evaluated in Avo's execution context, with record, resource, view, and field available. An omitted value, nil, or false (including a proc result) falls back to the option's default. These options have no field-level numeric validation.
-> height
The image height and CSS maximum height on Index and Show. Numeric values are interpreted as pixels. Strings ending in px are also supported by the maximum-height style.
field :logo, as: :external_image, height: 80- Type:
Numeric,String, orProcreturning either - Default:
40
-> radius
The CSS border radius on Index and Show, in pixels. The value is interpolated with a px suffix.
field :logo, as: :external_image, radius: 8- Type:
NumericorProcreturning a number - Default:
0
-> width
The width value exposed by the field.
field :logo, as: :external_image, width: 80- Type:
NumericorProcreturning a number - Default:
40
WARNING
The standard Index and Show image templates do not use this value. Setting it does not change their rendered image width. Show images have a fixed CSS maximum width of 340 pixels.
Record navigation
-> link_to_record
Wraps the Index image in a link to the record. The Show image remains unlinked. This option is checked for presence, not evaluated as a proc.
field :logo, as: :external_image, link_to_record: true- Type:
Boolean - Default:
false