dillonkearns/elm-pages-v3-beta/19.1.1

NOTE: the latest version is 21.0.0

Scaffold.Form

type Kind
= FieldInt
| FieldText
| FieldTextarea
| FieldFloat
| FieldTime
| FieldDate
| FieldCheckbox
{ fields : List ( String, Kind )
, elmCssView : Bool
, view :
{ formState : Context
, params :
List
{ name : String
, kind : Kind
, param : Expression
}
}
-> Expression
}
-> Maybe
{ formHandlers : Expression
, form : Expression
, declarations : List Declaration
}
restArgsParser : Option (List String) (List ( String, Kind )) RestArgsOption
type alias Context =
{ errors : Expression
, submitting : Expression
, submitAttempted : Expression
, data : Expression
, expression : Expression
}
fieldEncoder : Expression -> String -> Kind -> Expression
recordEncoder : Expression -> List ( String, Kind ) -> Expression

Generate a JSON Encoder for the form fields. This can be helpful for sending the validated form data through a BackendTask.Custom or to an external API from your scaffolded Route Module code.