GreenAsh.Field (GreenAsh v0.1.1)

Copy Markdown View Source

Introspection of an Ash action -> field specs -> HTML widget type.

From a resource and an action, lists the fillable fields (accepted attributes + arguments) and decides which widget to render for each Ash type. Unrecognized types fall back to a JSON textarea (with a log).

Summary

Functions

Decides the HTML widget's type= for a given Ash type.

Options {label, value} for a select widget, or nil if not an enum.

Ordered list of fillable fields for action on resource: first the accepted attributes, then the action's arguments.

Functions

input_type(type, constraints)

Decides the HTML widget's type= for a given Ash type.

options(type, constraints)

Options {label, value} for a select widget, or nil if not an enum.

specs(resource, action)

Ordered list of fillable fields for action on resource: first the accepted attributes, then the action's arguments.