drab v0.1.0 Drab.Controller

Turns on the Drab Commander on the pages generated by this controller.

To enable Drab on the specific page, you need to add the directive use Drab.Controller to the corresponding controller first, the use Drab.Commander in the commander module.

defmodule DrabExample.PageController do
  use Example.Web, :controller
  use Drab.Controller 

  def index(conn, _params) do
    render conn, "index.html"
  end
end    

By default Drab searches for the Commander with the name corresponding to the Controller, eg. NameController <-> NameCommander. You may specify the commander module by using commander option:

use Drab.Controller, commander: MyApp.NameController

See also Drab.Commander