Skip to content

Commit

Permalink
Document form[field] access quirks (#419)
Browse files Browse the repository at this point in the history
* Document Form + Ecto.Changeset may only be accessed by atom

* Document dynamic field creation via access
  • Loading branch information
rktjmp committed Mar 16, 2023
1 parent cad7b0d commit 4810b0a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/phoenix_html/form.ex
Expand Up @@ -14,7 +14,11 @@ defmodule Phoenix.HTML.Form do
The field name can be either an atom or a string. If it is an atom,
it assumes the form keeps both data and errors as atoms. If it is a
string, it considers data and errors are stored as strings for said
field.
field. Forms backed by an `Ecto.Changeset` only support atom field names.
It is possible to "access" fields which do not exist in the source data
structure. A `Phoenix.HTML.FormField` struct will be dynamically created
with some attributes such as `name` and `id` populated.
"""

alias Phoenix.HTML.Form
Expand Down

0 comments on commit 4810b0a

Please sign in to comment.