Basic usage
A Habarico resource is a controller that includes the engine's concern and declares what the frontend may do with the underlying model: which records to load, who may read or change them, which fields exist and which views are available.
The pages in this section follow the order in which a resource is usually built up:
| Page | What it covers |
|---|---|
| Controller setup | The minimal working resource |
| Context object | What the request context carries |
| Permissions | Read/create/update/delete rules |
| Data loading | Scopes, eager loading and record lookup |
| Field types | Declaring the fields a resource exposes, and the types they get |
| Views | List, show, create, edit and their layouts |
| Custom schema generators | Taking over schema generation |
| Global search | Cross-resource search |
| Aggregation 🔒 | The /aggregate endpoint feeding charts and dashboard widgets — paid |
| Response field selection | Trimming a response to the fields a caller needs with ?fields= |