View Source LiveAdmin.Router (LiveAdmin v0.12.1)

Link to this section Summary

Functions

Defines a resource to be included in a LiveAdmin UI.

Defines a group of LiveAdmin resources that share a common path prefix, and optionally, configuration.

Link to this section Functions

Link to this macro

admin_resource(path, resource_mod)

View Source (macro)

Defines a resource to be included in a LiveAdmin UI.

For each configured resource at path /foo, the following routes will be added:

  • /foo - List view
  • /foo/new - New record form
  • /foo/:id/edit - Update record form
Link to this function

build_session(conn, base_path, opts)

View Source
Link to this macro

live_admin(path, opts \\ [], list)

View Source (macro)

Defines a group of LiveAdmin resources that share a common path prefix, and optionally, configuration.

arguments

Arguments

  • path - Defines a scope to be added to the router under which the resources will be grouped in a single live session
  • opts - Configuration for this LiveAdmin scope. In addition to global options:
    • title (binary) - Title to display in nav bar
    • on_mount (tuple) - Module function when routes are mounted that will receive and should return session
Link to this function

on_mount(atom, params, map, socket)

View Source