3.1 New page Form Input option - commutatus/cm-admin Wiki

Description:

To define input field inside the form, either new page or the edit page.

Basic syntax:

  form_field :column_name, input_type: :string

DSL explanation

form_field accepts the following arguments.

Keyword Format Accepted value Description
input_type symbol [ :integer, :decimal, :string, :single_select, :multi_select, :date, :date_time, :text, :single_file_upload, :multi_file_upload, :hidden] One of the accepted values needs to be passed to input_type
label string This will overwrite the label.
collection array This will be used when the input_type is select.
disabled boolean This will disable the input field.

input_type accepted values explanation

Keyword Description
:integer To be used when you want only accept integer values
:decimal To be used when you want only accept decimal values
:string To be used when you want only accept string input
:single_select To be used when you want select and only one option to be selected
:multi_select To be used when you want select and multiple option to be selected
:date To be used when you need date dropdown
:date_time To be used when you need date and time dropdown
:text To be used when you need text input
:single_file_upload To be used when you upload a file (single)
:multi_file_upload To be used when you upload multiple file
:hidden To be used when you want to hide the input