Text API
Per-option reference for the Text field; see the Text guide for tasks and examples.
Pass these options to a field declaration in your resource's fields method, for example in app/avo/resources/post.rb:
field :title, as: :text, link_to_record: trueFor options shared by all fields, see Field options.
Display options
-> protocol
Turns the value into a link on Index and Show views when the configured protocol is present. The destination is "#{protocol}:#{value}", with the value as the link text. Blank protocols do not create protocol links.
field :email, as: :text, protocol: :mailto- Type:
StringorSymbol - Default:
nil - Values: A protocol name without the trailing colon, such as
:mailto,:tel, or a custom string. There is no fixed enum. - Validation: No protocol allowlist or type validation is applied; the value is interpolated into the destination.
-> link_to_record
Wraps the value in a link to the record on the Index view. It has no effect on the Show view or on forms, and is ignored when HTML or protocol rendering takes precedence.
field :title, as: :text, link_to_record: true- Type: Boolean
- Default:
false - Values:
trueenables the option;falsedisables it.niland non-Boolean values fall back tofalse.
-> as_html
Renders the value as raw HTML on Index and Show views. It takes precedence over both link options and does not change form inputs.
field :title, as: :text, as_html: true- Type: Boolean
- Default:
false - Values:
trueenables the option;falsedisables it.niland non-Boolean values fall back tofalse.
Unsafe HTML
The value is rendered without escaping or sanitization. Untrusted content can execute scripts; only trusted or already sanitized HTML is safe to render this way.
Rendering precedence
On Index and Show views, as_html: true wins over a present protocol. On Index, a present protocol wins over link_to_record; otherwise the value is linked only when link_to_record: true. On Show, link_to_record is not used. Without HTML or link rendering, the value is displayed as escaped text.
New and Edit forms always use a text input; none of these options changes its type.