
enoonan
Programming Phoenix LiveView: Use Schemaless Changesets In Liveview - demo adding @form before opening "/promo"
In this section, at the point where it tells the reader to “Start up the server, log in, and point your browser at /promo… You should see the following: [image of the Promo page]” …
… it hasn’t yet gone through the code where you add the form to the socket assigns. So it causes this error:
key :form not found in: %{
socket:
...
Up to this point the PromoLive module only includes a stubbed out mount function:
def mount(_params, _session, socket) do
{:ok, socket}
end
My suggestion would be either putting the instruction to “Start up the server” etc after the form code has been added, or don’t include the @form in the HEEX markup right off the bat.
EDIT:
So actually, right after the code where the @form gets added to the socket, it says “Now that we’ve created a form…and added it to our socket assigns, let’s render it in our template” and then shows the same HEEX markup as before.
So I think this may just be a case where a section got moved from one spot to another and didn’t get deleted from the original spot.
EDIT 2:
Ok yes. The first image of the Promo page doesn’t even include the form fields, but the second one that comes later does. Further evidence that the @form was just left in that first HEEX bit accidentally.
First Post!

SophieDeBenedetto
Thank you! We will fix this
Popular Pragmatic topics










Other popular topics










Latest in PragProg
Latest (all)
Categories:
Popular Portals
- /elixir
- /rust
- /wasm
- /ruby
- /erlang
- /phoenix
- /keyboards
- /js
- /rails
- /python
- /security
- /go
- /swift
- /vim
- /clojure
- /java
- /haskell
- /emacs
- /svelte
- /onivim
- /typescript
- /crystal
- /c-plus-plus
- /tailwind
- /kotlin
- /gleam
- /react
- /flutter
- /elm
- /ocaml
- /vscode
- /opensuse
- /ash
- /centos
- /php
- /deepseek
- /zig
- /scala
- /html
- /debian
- /nixos
- /lisp
- /agda
- /textmate
- /react-native
- /sublime-text
- /kubuntu
- /arch-linux
- /ubuntu
- /revery
- /manjaro
- /django
- /spring
- /diversity
- /nodejs
- /lua
- /julia
- /c
- /slackware
- /neovim