Skip to main content

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:

PageWhat it covers
Controller setupThe minimal working resource
Context objectWhat the request context carries
PermissionsRead/create/update/delete rules
Data loadingScopes, eager loading and record lookup
Field typesDeclaring the fields a resource exposes, and the types they get
ViewsList, show, create, edit and their layouts
Custom schema generatorsTaking over schema generation
Global searchCross-resource search
Aggregation 🔒The /aggregate endpoint feeding charts and dashboard widgets — paid
Response field selectionTrimming a response to the fields a caller needs with ?fields=