formex v0.3.2 Formex.Button
Summary
Types
Functions
Defines the Formex.Button struct.
:name
- a field name. By default the same as:type
:type
- a type of a field that in most cases will be the name of a function fromPhoenix.HTML.Form
:label
- the text label:opts
- options
Creates a new button.
type
is the name of function from Phoenix.HTML.Form
. May be either :submit
or :reset
.
Options
:name
- optional name of the button.If you added the button this way:
form |> add_button(:submit, "Save")
you can access it in the template by calling:
<%= formex_row f, :submit %>
But if you pass the
:name
option:form |> add_button(:submit, "Save", name: :special_submit)
you can access it by this name:
<%= formex_row f, :special_submit %>