I’m new to pheonix and just going throught the getting started, I can’t find where to learn more about forms and the whole /new → post /create → get /show flow… sorry if this is a dumb question but I’m kinda confused
Someone on discord just gave me this answer: :
Are you using plain old Phoenix or Phoenix LiveView?
- For LiveView, there’s a guide for Form Bindings that you can read through here: https://hexdocs.pm/phoenix_live_view/form-bindings.html
For plain old Phoenix, form submissions are just requests, so your controller receives the form params as part of the request, and you can do what you want with the request. You can find an example of this in the Phoenix guide for data modeling: https://hexdocs.pm/phoenix/your_first_context.html, and if you start with the generators (which is generally recommended for learning purposes by the docs) then you’ll see how the pages and controllers are set up by the generators for doing CRUD operations.
Hey! I’m a relative newbie to Phoenix as well. From what I’ve understood, the default choice for rendering UIs (including forms) in Phoenix is to use LiveView. In this case, the official docs you’re looking for is this: Form bindings — Phoenix LiveView v1.1.19
However, I’d strongly recommend going through a guided tutorial to get your bearings before diving into hexdocs for these packages. I found Pragmatic Studio’s Full Stack Phoenix course super helpful in getting a basic understanding of how everything fits together in Phoenix: Full-Stack Phoenix Course | The Pragmatic Studio
After going through that, it was easier for me to navigate through the (sometimes) oddly organized official docs.
Yes, the docs feel a bit confusing at first, and SEO seems a bit poor
Currently I’m broke so can’t spend that much on a course, but still thanks for the recommendation
The Phoenix generators are a great tool for learning how to do stuff in Phoenix:
For your needs, read the docs for mix phx.gen.schema to get some background info on how the generators work, then check out mix phx.gen.html to generate some CRUD HTML forms.
From experience, I recommend copying the examples by hand (so you can see how to re-create them from the ground up), and extend them for your needs. Get messy, learn, have fun, etc.
P.S. You’ll probably want to create a new Phoenix project to play around with this stuff at first.
P.P.S. Always make a Git commit before running Phoenix generators!!! They can add and change a lot of files.
Thanks a lot, didn’t know about this






















