View Source AshAdmin.Router (ash_admin v0.10.7)

Provides LiveView routing for AshAdmin.

Summary

Functions

Can be used to create a :browser pipeline easily if you don't have one.

Defines an AshAdmin route. It expects the path the admin dashboard will be mounted at and a set of options.

Functions

Link to this macro

admin_browser_pipeline(name \\ :browser)

View Source (macro)

Can be used to create a :browser pipeline easily if you don't have one.

By default it is called :browser, but you can rename it by supplying an argument, for example:

defmodule MyAppWeb.Router do
  use Phoenix.Router

  import AshAdmin.Router
  admin_browser_pipeline :something

  scope "/" do

    pipe_through [:something]
    ash_admin "/admin"
  end
end
Link to this macro

ash_admin(path, opts \\ [])

View Source (macro)

Defines an AshAdmin route. It expects the path the admin dashboard will be mounted at and a set of options.

Examples

defmodule MyAppWeb.Router do
  use Phoenix.Router

  scope "/" do
    import AshAdmin.Router

    # Make sure you are piping through the browser pipeline
    # If you don't have one, see `admin_browser_pipeline/1`
    pipe_through [:browser]

    ash_admin "/admin"
  end
end