AshAdmin.Router (ash_admin v0.2.8) View Source

Provides LiveView routing for AshAdmin.

Link to this section 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.

Link to this section 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",
      apis: [MyApp.Api1, MyApp.Api2]
  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.

Options

  • :apis - The list of Apis to include in the admin dashboard

    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",
      apis: [MyApp.Api1, MyApp.Api2]

    end end