formex v0.1.3 Formex.Builder
Summary
Functions
Creates a form struct
Invokes Repo.insert
. In case of :error
returns {:error, form}
(with new form.changeset
value) instead of {:error, changeset}
(as Ecto does)
Invokes Repo.update
. In case of :error
returns {:error, form}
(with new form.changeset
value) instead of {:error, changeset}
(as Ecto does)
Functions
Creates a form struct.
Arguments
type
- the module that implementsFormex.Type
, for example:App.ArticleType
struct
- the struct that will be used inEcto.Changeset.cast
, for example:%App.Article{}
params
- params that will be used inEcto.Changeset.cast
insert_form_data(form)
insert_form_data(Formex.Form.t) :: {:ok, Ecto.Schema.t} | {:error, Formex.Form.t}
Invokes Repo.insert
. In case of :error
returns {:error, form}
(with new form.changeset
value) instead of {:error, changeset}
(as Ecto does)
update_form_data(form)
update_form_data(Formex.Form.t) :: {:ok, Ecto.Schema.t} | {:error, Formex.Form.t}
Invokes Repo.update
. In case of :error
returns {:error, form}
(with new form.changeset
value) instead of {:error, changeset}
(as Ecto does)