You are absolutely right. It took me to the next one, specifically
<%= render("navbar.html", conn: @conn, current_user: @current_user) %>
which is visible on the original app.html.heex
added here. So I would have to rewrite everything, if I understand it correctly.
I’m adding Endpoint because I don’t understand how Benjamin meant it.
defmodule MyWebApp.Endpoint do
use Phoenix.Endpoint, otp_app: :my_app
use Appsignal.Phoenix
# The session will be stored in the cookie and signed,
# this means its contents can be read but not tampered with.
# Set :encryption_salt if you would also like to encrypt it.
# hibernate_after - wait 45 seconds before end connection (heroku timeout is 55 sec)
@session_options [
store: :cookie,
key_iterations: 500,
key: "_my_app_key",
signing_salt: Application.compile_env!(:my_app, :signing_salt),
hibernate_after: 45_000
]
socket "/socket", MyWebApp.UserSocket,
websocket: true,
longpoll: false
socket "/live", Phoenix.LiveView.Socket, websocket: [connect_info: [session: @session_options]]
# Serve at "/" the static files from "priv/static" directory.
#
# You should set gzip to true if you are running phx.digest
# when deploying your static files in production.
plug Plug.Static,
at: "/",
from: :my_app,
gzip: false,
only:
~w(css fonts images documents js favicon.ico robots.txt android-chrome-192x192.png android-chrome-512x512.png android-chrome-96x96.png apple-touch-icon.png favicon.ico favicon-16x16.png favicon-32x32.png mstile-150x150.png )
plug Plug.Static,
at: "/uploads",
from: Path.expand("./uploads"),
gzip: false
# Code reloading can be explicitly enabled under the
# :code_reloader configuration of your endpoint.
if code_reloading? do
socket "/phoenix/live_reload/socket", Phoenix.LiveReloader.Socket
plug Phoenix.LiveReloader
plug Phoenix.CodeReloader
end
plug Plug.RequestId
plug Plug.Telemetry, event_prefix: [:phoenix, :endpoint]
plug Plug.Parsers,
parsers: [:urlencoded, :multipart, :json],
pass: ["*/*"],
json_decoder: Phoenix.json_library(),
length: 100_000_000
plug Plug.MethodOverride
plug Plug.Head
plug Plug.Session, @session_options
plug Pow.Plug.Session, otp_app: :my_app
plug MyWebApp.Plugs.ReloadUserPlug
plug MyWebApp.Router
end
Footnote.
I also tried creating a branch where I overwrote most of the :view to :html, then overwrote all the render/2 functions. I ran into a number of other errors though. For example, it was rendering something according to the new Layouts module and querying LayoutView somewhere, so I had both. Some forms required the new HTML module, but some still queried the old View module and I didn’t know why. I could go on. So I went back to the original tutorial where they kept the View where I’m now struggling with this.