DestyNova

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 in ProductLive.Form, not Index

  • p82: What’s going on with the output of mix test here? 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 generates changeset/3 and expects a user scope as the final argument.

    • I had to do something like this instead: Product.changeset(product, attrs, Scope.for_user(%User{}))
  • p93: Notice that each of them uses/use/uses

  • p97: This code uses the changeset/2 function – It’s changeset/3 now, since the scope param was added.

  • p97: scope = Accounts.get_scope_for_user(user.id) – I can’t find any mention of a get_scope_for_user function 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)

Where Next?

Popular Pragmatic Bookshelf topics Top

jon
Some minor things in the paper edition that says “3 2020” on the title page verso, not mentioned in the book’s errata online: p. 186 But...
New
jesse050717
Title: Web Development with Clojure, Third Edition, pg 116 Hi - I just started chapter 5 and I am stuck on page 116 while trying to star...
New
Alexandr
Hi everyone! There is an error on the page 71 in the book “Programming machine learning from coding to depp learning” P. Perrotta. You c...
New
raul
Hi Travis! Thank you for the cool book! :slight_smile: I made a list of issues and thought I could post them chapter by chapter. I’m rev...
New
rmurray10127
Title: Intuitive Python: docker run… denied error (page 2) Attempted to run the docker command in both CLI and Powershell PS C:\Users\r...
New
jeremyhuiskamp
Title: Web Development with Clojure, Third Edition, vB17.0 (p9) The create table guestbook syntax suggested doesn’t seem to be accepted ...
New
adamwoolhether
I’m not quite sure what’s going on here, but I’m unable to have to containers successfully complete the Readiness/Liveness checks. I’m im...
New
brunogirin
When trying to run tox in parallel as explained on page 151, I got the following error: tox: error: argument -p/–parallel: expected one...
New
brunogirin
When running tox for the first time, I got the following error: ERROR: InterpreterNotFound: python3.10 I realised that I was running ...
New
dachristenson
I just bought this book to learn about Android development, and I’m already running into a major issue in Ch. 1, p. 20: “Update activity...
New

Other popular topics Top

PragmaticBookshelf
Stop developing web apps with yesterday’s tools. Today, developers are increasingly adopting Clojure as a web-development platform. See f...
New
PragmaticBookshelf
Write Elixir tests that you can be proud of. Dive into Elixir’s test philosophy and gain mastery over the terminology and concepts that u...
New
dasdom
No chair. I have a standing desk. This post was split into a dedicated thread from our thread about chairs :slight_smile:
New
PragmaticBookshelf
Design and develop sophisticated 2D games that are as much fun to make as they are to play. From particle effects and pathfinding to soci...
New
AstonJ
There’s a whole world of custom keycaps out there that I didn’t know existed! Check out all of our Keycaps threads here: https://forum....
New
Exadra37
Oh just spent so much time on this to discover now that RancherOS is in end of life but Rancher is refusing to mark the Github repo as su...
New
New
DevotionGeo
I have always used antique keyboards like Cherry MX 1800 or Cherry MX 8100 and almost always have modified the switches in some way, like...
New
New
PragmaticBookshelf
Use advanced functional programming principles, practical Domain-Driven Design techniques, and production-ready Elixir code to build scal...
New

Sub Categories: