Alkemist v1.0.1-rc Alkemist.Router

Provides helper functions to generate admin resource paths.

Usage:

defmodule MyApp.Router do
  use Phoenix.Router
  use Alkemist.Router

end

Link to this section Summary

Functions

Registers the routes for a manager resource

Callback invoked by Plug on every request

Callback required by Plug that initializes the router for serving web requests

Link to this section Functions

Link to this macro alkemist_resources(path, controller) (macro)

See alkemist_resources/3

Link to this macro alkemist_resources(path, controller, opts) (macro)

Registers the routes for a manager resource

Usage:

defmodule MyApp.Router do
  ...

  scope "/admin", MyApp do
    pipe_through :browser
    alkemist_resources "/users", UserController, except: [:delete]
  end
end

Possible options are:

  • :except - Array of actions to exclude from generating the routes
  • :only - when provided, only routes for the provided actions are created
Link to this function call(conn, opts)

Callback invoked by Plug on every request.

Callback required by Plug that initializes the router for serving web requests.