formex v0.4.4 Formex.Form
Summary
Functions
Defines the Formex.Form struct
Creates a form for assoc
Returns list of Formex.Field.t/0
Returns list of Formex.FormNested.t/0 and Formex.FormCollection.t/0
Adds field to the form. More: Formex.Field.create_field/4, Formex.Button.create_button/3
Types
Functions
Defines the Formex.Form struct.
:type- the module that implementsFormex.Type, for example:App.ArticleType:struct- the struct that will be used inEcto.Changeset.cast, for example:%App.Article{}:model-struct.__struct__, for example:App.Article:items- list ofFormex.FieldandFormex.Buttonstructs:params- params that will be used inEcto.Changeset.cast:changeset-%Ecto.Changeset{}:phoenix_form-%Phoenix.HTML.Form{}:template- the module that implementsFormex.Template, for example:Formex.Template.BootstrapHorizontal. Can be set via aFormex.View.formex_form_foroptions
create_subform(form, type, name, opts \\ [])
create_subform(form :: Formex.Form.t, type :: any, name :: Atom.t, opts :: Map.t) :: Formex.Form.t
Creates a form for assoc.
Example:
form
|> add_form(:user_info, App.UserInfoType)
Options
required- is the subform required.Defaults to
true. This option will be passed toEcto.Changeset.cast_assoc/3
Returns list of Formex.Field.t/0
Returns list of Formex.FormNested.t/0 and Formex.FormCollection.t/0
Adds field to the form. More: Formex.Field.create_field/4, Formex.Button.create_button/3