From ec3764e02f4b8bf2ab5cb4adeeab1b73631c2d66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Sat, 28 Oct 2023 09:06:09 +0200 Subject: [PATCH] Improve docs --- lib/phoenix_html/form.ex | 8 ++++++++ lib/phoenix_html/form_data.ex | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/phoenix_html/form.ex b/lib/phoenix_html/form.ex index 53a7eec..849da38 100644 --- a/lib/phoenix_html/form.ex +++ b/lib/phoenix_html/form.ex @@ -5,6 +5,9 @@ defmodule Phoenix.HTML.Form do @moduledoc ~S""" Define a `Phoenix.HTML.Form` struct and functions to interact with it. + For building actual forms in your Phoenix application, see + [the `Phoenix.Component.form/1` component](https://hexdocs.pm/phoenix_live_view/Phoenix.Component.html#form/1). + ## Access behaviour The `Phoenix.HTML.Form` struct implements the `Access` behaviour. @@ -19,6 +22,11 @@ defmodule Phoenix.HTML.Form do 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. + + ## Custom implementations + + There is a protocol named `Phoenix.HTML.FormData` which can be implemented + by any data structure that wants to be cast to the `Phoenix.HTML.Form` struct. """ alias Phoenix.HTML.Form diff --git a/lib/phoenix_html/form_data.ex b/lib/phoenix_html/form_data.ex index 1444d35..035d5dd 100644 --- a/lib/phoenix_html/form_data.ex +++ b/lib/phoenix_html/form_data.ex @@ -1,6 +1,6 @@ defprotocol Phoenix.HTML.FormData do @moduledoc """ - Converts a data structure into a [`Phoenix.HTML.Form`](`t:Phoenix.HTML.Form.t/0`) struct. + Converts a data structure into a `Phoenix.HTML.Form` struct. ## Ecto integration