DestyNova

DestyNova

Book-programming-phoenix-liveview:b0.14-errata-p1-131

  • p2: we update a yet another element. Delete "a ".
  • p11: you might seeing – s/seeing/see/
  • p12: <imagedata fileref=”images/intro/phoenix-new.png … this fileref seems to be missing a closing double-quote, which breaks the parser and doesn’t insert the image.
  • p21: The code block in “Handle Events” doesn’t quite match the previous definition, in a trivial way ({n} vs <%= n %>)
  • p25: you should see the actual data that’s sent up to the browser when the user clicks a number – this is worded confusingly. That data is what’s sent //from// the browser to the server when the user clicks a number.
  • p27: the time/0 was not re-invokedthe time/0 function
  • p47: The :fetch_current_scope_for_user plug runs early in the browser pipeline, – the generator now adds it automatically as the last plug in the browser pipeline.
  • p48: Instead of looking up users by tokens in each LiveView, the scope is automatically available: – it’s not though, since we haven’t specified that /wrong requires an authenticated user in the router yet, so trying to add current_user here breaks the liveview. Is this just an example rather than a change we should make while following along?
  • p52: confirm_user/1 – this no longer seems to exist in the Accounts exports, as of Phoenix 1.8.1.
  • p58: plug(:put_root_layout, – this appears twice in the snippet, but with Phoenix 1.8.1 it only shows up once, in the browser pipeline.
  • p70: we can simplify the WrongLive’s own mount function, so that it looks like this: – this seems to be the exact same definition we had on page 67.
  • p72: If a logged in user visits the / route, make them redirect to the /guess route.
    • It was not obvious how to do this. I searched for a redirect function to use in router.ex, but couldn’t find one. The closest was forward which didn’t seem appropriate.
    • Instead, I tried adding a second function to PageController, and referencing that instead of :home in the redirect_if_user_is_authenticated route block. It would be good to have some “here’s how you could have done it” sections after the exercises.
  • p80: Notice the significant improvements in Phoenix 1.8’s generator output. – improvements compared to what? In a book written for Phoenix 1.8, it’s likely that almost no readers will remember what the generator output of older versions of Phoenix would look like.
  • p89: The Ecto.Changeset.cast/4 function filters the user data we pass into params.s/params/attrs
  • p93: Notice that each of them use the Repo module, => s/use/uses
  • p100: Whenever Catalog.validate_code/1 fails to return the :ok tuple, our code will blow up. – It’s Validator.validate_code/1 that can blow our code up this way. Catalog.validate_code/1 tries to pattern match on this result, and will throw an error. It never returns an {:ok, ...} tuple to apply_coupon_code/2.
  • p116: With just a hand full => handful
  • p131: This tell LiveViews/tell/tells

Where Next?

Popular Pragmatic Bookshelf topics Top

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
herminiotorres
Hi! I know not the intentions behind this narrative when called, on page XI: mount() |&gt; handle_event() |&gt; render() but the correc...
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
adamwoolhether
When trying to generate the protobuf .go file, I receive this error: Unknown flag: --go_opt libprotoc 3.12.3 MacOS 11.3.1 Googling ...
New
jgchristopher
“The ProductLive.Index template calls a helper function, live_component/3, that in turn calls on the modal component. ” Excerpt From: Br...
New
digitalbias
Title: Build a Weather Station with Elixir and Nerves: Problem connecting to Postgres with Grafana on (page 64) If you follow the defau...
New
brunogirin
When I run the coverage example to report on missing lines, I get: pytest --cov=cards --report=term-missing ch7 ERROR: usage: pytest [op...
New
kolossal
Hi, I need some help, I’m new to rust and was learning through your book. but I got stuck at the last stage of distribution. Whenever I t...
New
dachristenson
@mfazio23 Android Studio will not accept anything I do when trying to use the Transformations class, as described on pp. 140-141. Googl...
New
New

Other popular topics Top

Devtalk
Hello Devtalk World! Please let us know a little about who you are and where you’re from :nerd_face:
New
Devtalk
Reading something? Working on something? Planning something? Changing jobs even!? If you’re up for sharing, please let us know what you’...
1050 21151 394
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
DevotionGeo
I know that -t flag is used along with -i flag for getting an interactive shell. But I cannot digest what the man page for docker run com...
New
AstonJ
If you are experiencing Rails console using 100% CPU on your dev machine, then updating your development and test gems might fix the issu...
New
AstonJ
Biggest jackpot ever apparently! :upside_down_face: I don’t (usually) gamble/play the lottery, but working on a program to predict the...
New
mafinar
This is going to be a long an frequently posted thread. While talking to a friend of mine who has taken data structure and algorithm cou...
New
New
Help
I am trying to crate a game for the Nintendo switch, I wanted to use Java as I am comfortable with that programming language. Can you use...
New
PragmaticBookshelf
A concise guide to MySQL 9 database administration, covering fundamental concepts, techniques, and best practices. Neil Smyth MySQL...
New

Sub Categories: