Skip to main content

Module ui

Module ui 

Source

Functionsยง

base_context
Base template context: title, mount prefix, and the navigation menus.
dashboard
Render the top-level dashboard.
default_fields
Build a default field list (for create/edit forms) from a set of column names, when a resource provides no explicit form_structure.
derive_headers
Derive table column headers from a set of rows: the primary key first, then the remaining keys of the first row in their natural order.
fields_from_structure
Extract a flat fields array from an explicit form_structure value. Supports { "groups": [ { "fields": [...] } ] } and { "fields": [...] }.
form_to_json
Turn a submitted HTML form (all string values) into a typed JSON object: "true"/"false" โ†’ bool, integer/float text โ†’ number, everything else stays a string.
humanize
created_at โ†’ Created At.
render
Render a named template into an HTML ApiResponse.
render_with_csrf
Render a page that contains a POST form, putting a CSRF token in scope as csrf_token and setting the cookie when a fresh one had to be minted. Every template rendered through this must echo the token into a hidden _csrf field, or its form will be rejected by crate::csrf::verify on submit.