Avo
Guidelines
- Full LLM docs for Avo:
#fetch https://docs.avohq.io/3.0/llms-full.txt.
Adding Resources
Avo resources go in app/avo/resources.
Use this as the baseline structure for a new Avo resource:
# frozen_string_literal: true
class Avo::Resources::NewResource < Avo::BaseResource
def fields
field :id
[belongs_to and attribute fields here]
tasks_field
timestamp_fields
[has_one association fields here]
[has_many association fields here]
end
_baseline_finalize
end
Always add a matching controller in app/controllers/avo as well:
# frozen_string_literal: true
class Avo::NewResourcesController < Avo::ResourcesController
end
Fields
Fields can be added without specifying a type via the :as parameter:
field :name
field :pdf_file
field :processed_at
If no :as parameter is present, the type and default attributes are determined automatically. See Baseline::ActsAsAvoResource#field in Baseline for details.
