Router
Run mix phx.routes
to see route list
lib/eServer_web/router.ex
Adding Routes
In the scope, its http-verb, Controller, and function in that controller
Then add a controller and view
Expands out to
ACTION
Route
Function
GET
/users
HelloWeb.UserController :index
GET
/users/:id/edit
HelloWeb.UserController :edit
GET
/users/new
HelloWeb.UserController :new
GET
/users/:id
HelloWeb.UserController :show
POST
/users
HelloWeb.UserController :create
PATCH
/users/:id
HelloWeb.UserController :update
PUT
/users/:id
HelloWeb.UserController :update
DELETE
/users/:id
HelloWeb.UserController :delete
More
get is actually a Phoenix macro that is one clause of a match for HTTP get request
Error handling in the default error view, default is returning name from status code
Last updated