DestyNova
Programming Phoenix LiveView: B0.14 errata, part 2
-
p81:
live "/products/new", ProductLive.Index, :new– as you noted just above, the generator in Phoenix 1.8 puts this inProductLive.Form, notIndex -
p82: What’s going on with the output of
mix testhere? It looks like old output for Phoenix 1.7 (with fails) is immediately followed by new output for Phoenix 1.8 (with no fails). Perhaps delete the 1.7 output. -
p82: However, the tests actually fail for me because an exercise on page 72 requests of the reader:
If a logged in user visits the / route, make them redirect to the /guess route.– this causes the login tests to fail. Perhaps you could mention this and tell the reader to revert that change. -
p86:
create unique_index(:products, [:sku])– Phoenix 1.8.1 also added the following line before this:create index(:products, [:user_id]) -
p87:
Notice the use Ecto.Schema expression.– that line isn’t included in the code snippet above (although it is in the generated file). -
p88:
We build a struct using the embedded function.– what is meant by “embedded function” here? -
p90:
Product.changeset(product, attrs)– this doesn’t work since, as shown on the previous page, Phoenix 1.8 now generateschangeset/3and expects a user scope as the final argument.- I had to do something like this instead:
Product.changeset(product, attrs, Scope.for_user(%User{}))
- I had to do something like this instead:
-
p93:
Notice that each of them use–s/use/uses -
p97:
This code uses the changeset/2 function– It’schangeset/3now, since the scope param was added. -
p97:
scope = Accounts.get_scope_for_user(user.id)– I can’t find any mention of aget_scope_for_userfunction anywhere online. Please tell me this section wasn’t generated by ChatGPT?- Instead, I had to do this:
scope = Pento.Accounts.Scope.for_user(user)
- Instead, I had to do this:
Popular Pragmatic Bookshelf topics
Other popular topics
Categories:
Sub Categories:
Popular Portals
- /elixir
- /rust
- /wasm
- /ruby
- /erlang
- /phoenix
- /keyboards
- /python
- /js
- /rails
- /security
- /go
- /swift
- /vim
- /clojure
- /emacs
- /haskell
- /java
- /svelte
- /onivim
- /typescript
- /kotlin
- /crystal
- /c-plus-plus
- /tailwind
- /react
- /gleam
- /ocaml
- /elm
- /flutter
- /vscode
- /ash
- /html
- /opensuse
- /zig
- /centos
- /deepseek
- /php
- /scala
- /react-native
- /lisp
- /textmate
- /sublime-text
- /nixos
- /debian
- /agda
- /django
- /deno
- /kubuntu
- /arch-linux
- /nodejs
- /revery
- /ubuntu
- /manjaro
- /spring
- /lua
- /diversity
- /julia
- /markdown
- /c








