The introduction instructions under section “Build a Simple LiveView” are incomplete. If followed from book one gets the following error:
[error] #PID<0.745.0> running Phoenix.Endpoint.SyncCodeReloadPlug (connection #PID<0.659.0>, stream id 9) terminated
Server: localhost:4000 (http)
Request: GET /guess
** (exit) an exception was raised:
** (ArgumentError) no "live" html template defined for PentoWeb.LayoutView
(phoenix_template 1.0.1) lib/phoenix/template.ex:241: Phoenix.Template.render_with_fallback/4
This is because (I think) we put “live.html” in the following line on page 16:
use Phoenix.LiveView, layout: {PentoWeb.LayoutView, "live.html"}
I think it should be changed to/modified to the following:
use Phoenix.LiveView
So the control is directly passed to the render
function, rather than asking it to look for a live.html.