4.1 Options Cheat Sheet - formtastic/formtastic GitHub Wiki
:url
:html
:url
:html
:update
-
Formtastic Fieldsetโs Legend Title String
-
:name
or:title
-
-
HTML fieldset attributes
- Standard Attributes โ
:class
,:dir
,:id
,:lang
,:style
,:title
,:xml:lang
- Event Attributes โ
:onclick
,:ondblclick
,:onmousedown
,:onmousemove
,:onmouseout
,:onmouseover
,:onmouseup
,:onkeydown
,:onkeypress
,:onkeyup
- Standard Attributes โ
-
:as
โ override the input type (eg force a :string to render as a:password
field)
-
:collection
โ customizes the options available in the select by passing in a collection (an Array or Hash)
-
:prompt
โ by default, all select inputs will have a blank option at the top of the list. You can add a prompt with the :prompt option, or disable the blank option with :include_blank => false.
-
:hint
โ provide some text to hint or help the user provide the correct information for a field
-
:input_html
โ provide options that will be passed down to the generated input
-
:label
โ use something other than the method name as the label text, when false no label is printed
-
:member_label
allows you to customize the text label inside each option tag two ways:- by naming the correct method to call on each object in the collection as a symbol (:name, :login, etc)
- by passing a Proc that will be called on each object in the collection, allowing you to use helpers or multiple model attributes together
-
:member_value
โ provides the same customization of the value attribute of each option tag
-
:required
โ specify if the column is required (true) or not (false)
-
:wrapper_html
โ provide options that will be passed down to the li wrapper
-
:checked_value
and:unchecked_value
โ change the checked and unchecked values for boolean fields
-
:button_html
โ provide options that will be passed down to the generated button
See inputs options for html attributes and special options