I am almost done going through the book, Programming Phoenix 1.4, again after a hiatus from using Elixir for a few years.
It seems that Phoenix has changed a lot since I last used it around version 1.2, especially the view layer with Phoenix.Component and HEEx templates.
I did my best to get caught up and translated the examples from the book using the new view layer style with components.
You can find my work on GitLab here:
My style is a little different from the authors, but hopefully the examples are close enough to get you unstuck. Please don’t mind the commit messages as I leave breadcrumbs for me to remember things when I come back to this work and refresh my memory.
I am posting here about it, because I thought maybe someone else might be working through the book, and could use some help translating from old to new. I hope folks find this useful, until the book has a chance to be updated.
Thank you for posting this, it’s extremely helpful for people learning Phoenix. Mis-match between the code in the book and the current version is frustrating, great work!
Does category input select in lib/rumbl_web/controllers/video_html/video_form.html.heex work fine for you?
When I use your code as is, the select neither has the proper value selected when opening edit video page, nor the changeset contains changed category_id when I save updated video.
When I use value={f.data.category_id}, the form has category value properly selected when opening edit video page, but still the changeset does not contain changed category_id when I save updated video.