phoenixframework / phoenix_live_view

Rich, real-time user experiences with server-rendered HTML
https://hex.pm/packages/phoenix_live_view
MIT License
6.14k stars 921 forks source link

Update to_form action in 'Form bindings' guide #3251

Closed rhcarvalho closed 3 months ago

rhcarvalho commented 4 months ago

Update the code example (4+ years old) to set the form/changeset action to a conventional name unrelated to database operations, as suggested elsewhere in the docs 1.

Also use the new :action option added to to_form in v1.0 2.


Notes:

  1. I've also reviewed other places where to_form is used, this was the only occurrence that seemed to deserve an update.
  2. I'm not strong about using the new option to_form(..., action: :validate); if we want to keep the example backwards-compatible we shall keep using a Map.put(:action, :validate).
SteffenDE commented 3 months ago

Thank you! 🙌