Skip to main content

form_render

Function form_render 

Source
pub async fn form_render(
    db: &Db,
    registry: &AdminRegistry,
    legacy_entries: &[AdminEntry],
    model: &dyn AdminUiModel,
    legacy_source: Option<&AdminEntry>,
    editing_id: Option<&str>,
    identity: Option<&Identity>,
    csrf_token: Option<&str>,
    form_error: Option<&str>,
) -> String
Expand description

Render the form page for GET /admin/:model/new (when editing_id = None) or GET /admin/:model/:id/edit (when editing_id = Some(id)).

legacy_source is Some(&entry) when the model came from the legacy AdminEntry path — this unlocks FK options enrichment (the legacy field type doesn’t carry pre-populated AdminUiField.options). For new-engine models this is None and their own registration code is responsible for options.