View Source LiveAdmin.Resource (LiveAdmin v0.9.3)
API for managing Ecto schemas and their individual record instances used internally by LiveAdmin.
To customize UI behavior, the following options may also be used:
title_with
- a binary, or MFA that returns a binary, used to identify the resourcelabel_with
- a binary, or MFA that returns a binary, used to identify recordslist_with
- an atom or MFA that identifies the function that implements listing the resourcecreate_with
- an atom or MFA that identifies the function that implements creating the resourceupdate_with
- an atom or MFA that identifies the function that implements updating a recorddelete_with
- an atom or MFA that identifies the function that implements deleting a recordvalidate_with
- an atom or MFA that identifies the function that implements validating a changed recordrender_with
- an atom or MFA that identifies the function that implements table field rendering logichidden_fields
- a list of fields that should not be displayed in the UIimmutable_fields
- a list of fields that should not be editable in formsactions
- list of atoms or MFAs that identify a function that operates on a recordtasks
- list atoms or MFAs that identify a function that operates on a resourcecomponents
- keyword list of component module overrides for specific views (:list
,:new
,:edit
,:home
,:nav
,:session
)
use LiveAdmin.Resource
This is required in any module that should act as a LiveAdmin Resource. If the module is not an Ecto schema, then the
:schema
option must be passed. Using this module will create a live_admin_config module variable and 2 functions to query it, live_admin_config/0 and live_admin_config/1. The former returns the entire config while the latter will return a key if it exists, otherwise it will fallback to either a global config for that key, or the key's default value.