digitallyinduced / ihp

🔥 The fastest way to build type safe web apps. IHP is a new batteries-included web framework optimized for longterm productivity and programmer happiness
https://ihp.digitallyinduced.com/
MIT License
4.91k stars 195 forks source link

Documentation on integrating a form into a View #1958

Open liammcdermott opened 5 months ago

liammcdermott commented 5 months ago

Problem

The documentation on forms is great, it makes building forms easy. However, when the user has written a form function, there doesn't seem to be anything in the docs describing how to integrate it into a View. In particular, I was confused by where post comes from in the form function parameters.

The documentation is also unclear on what happens when a form is submitted, and how to handle its life cycle in general.

Solution

Add to the forms section of the documentation: describe how to integrate a form into the greater application, and how to manage its life cycle.

I see the forms documentation has a section on Validation, but it's unclear on where that code should go in the application. The examples feel a bit unmoored from their context.

It is likely that I've skipped over some previous section that explained all this architecture. Which could be used as a reason to close this, but I doubt I'm the only one skipping around to the bits I'm interested in :smile: . If the documentation already exists, the form section should include a link to it.