How to Think About Phoenix Dead Views

From ElixirBlocks
Revision as of 09:21, 27 December 2024 by Admin (talk | contribs) (Created page with "Each page (resource) has a route. These routes are assigned a controller and a function from that controller. In the code below, when a user goes to the "/" route a controller named PageController is found and a function named home is invoked. Controllers are simply modules and the third argument (in this case named '''home''') is a function on the controller. <source> get "/", PageController, :home </source>")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Each page (resource) has a route.

These routes are assigned a controller and a function from that controller.

In the code below, when a user goes to the "/" route a controller named PageController is found and a function named home is invoked.

Controllers are simply modules and the third argument (in this case named home) is a function on the controller.

  get "/", PageController, :home