LiveReactIslands.Form (LiveReactIslands v0.1.1)

View Source

Helpers for using Phoenix changesets with React islands. Only available when Ecto is installed.

Note: You don't need to use this module directly, instead use init_form/3 and update_form/3 included with LiveReactIslands.Component.

Summary

Functions

Convert a changeset to full form props including schema info. Used by init_form/3 in the component.

Convert a changeset to form props (values and errors only). Used by update_form/3 in the component.

Functions

to_init_props(changeset, prop_name, version \\ 0, opts \\ [])

Convert a changeset to full form props including schema info. Used by init_form/3 in the component.

Options:

  • :translator - function to translate errors, defaults to app config or simple interpolation

to_props(changeset, prop_name, version, opts \\ [])

Convert a changeset to form props (values and errors only). Used by update_form/3 in the component.

Options:

  • :translator - function to translate errors, defaults to app config or simple interpolation