ExTeal.Resource behaviour (ExTeal v0.25.0) View Source
When used, includes all aspects of the functionality required to manage the resource.
Example usage in a ExTeal Resource:
defmodule ExampleWeb.ExTeal.BlogResource do
use ExTeal.Resource
alias Example.Content.Blog
def resource, do: Blog
def title, do: "blog"
end
Link to this section Summary
Callbacks
Provide a list of action cards to render them above the resource index
Override the default ordering of the index.
Hide the Resource from the sidenav in the user interface, defaults to false.
If you would like to separate resources into different sidebar groups, you can
override the nav_group/1
function on the resource.
Override the detail or edit link for a resource on the resource index.
Allows skipping sanitize for all fields on a resource
Specifies the field to use as the basis for a drag and drop interface for the collection.
Link to this section Types
Specs
attributes() :: map()
Specs
Specs
indexed_resource() :: struct() | pivot_resource()
Specs
orderable_key() :: :asc | :asc_nulls_first | :asc_nulls_last | :desc | :desc_nulls_first | :desc_nulls_last
Specs
orderable_option() :: {orderable_key(), atom()}
Specs
params() :: map()
Specs
Specs
record() :: struct()
Specs
records() :: [record()]
Specs
t() :: module()
Specs
validation_errors() :: Ecto.Changeset.t() | keyword()
Link to this section Callbacks
Specs
cards(Plug.Conn.t()) :: [module()]
Provide a list of action cards to render them above the resource index
Specs
default_order() :: [orderable_option()]
Override the default ordering of the index.
Specs
skip_sanitize() :: boolean() | nil
Allows skipping sanitize for all fields on a resource
Specs
sortable_by() :: String.t() | nil
Specifies the field to use as the basis for a drag and drop interface for the collection.