CRUD Patterns
← OverviewDemonstrates: create, edit, patch, update, delete — all inline, no page reload.
Items
| ID | Name | Status | Notes | Actions |
|---|---|---|---|---|
| 1 | Widget Alpha | active | First demo item | |
| 2 | Gadget Beta | inactive | Second demo item | |
| 3 | Doohickey Gamma | active | Third demo item |
Create
POST /hypermedia/crud/itemsAppends a new row by posting a form and swapping the placeholder row with the returned row fragment.
Edit
GET /hypermedia/crud/items/:id/editReplaces the display row with an inline edit form (outerHTML swap).
Update (PUT)
PUT /hypermedia/crud/items/:idSubmits the edit form; server returns the updated display row.
Patch (toggle)
PATCH /hypermedia/crud/items/:id/toggleFlips the status field without a full edit form.
Delete
DELETE /hypermedia/crud/items/:idRemoves the row from the DOM via hx-swap="delete" (no server fragment returned).