How to Think About Phoenix Dead Views: Difference between revisions
From ElixirBlocks
(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>") |
(No difference)
|
Latest revision as of 09:21, 27 December 2024
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