plataformatec/simple_form - 0 views
-
The basic goal of Simple Form is to not touch your way of defining the layout
-
Simple Form acts as a DSL and just maps your input type (retrieved from the column definition in the database) to a specific helper method.
- ...68 more annotations...
-
Simple Form generates a wrapper div around your label and input by default, you can pass any html attribute to that wrapper as well using the :wrapper_html option,
-
Simple Form will look at the column type in the database and use an appropriate input for the column
-
give the :disabled option to Simple Form, and it'll automatically mark the wrapper as disabled with a CSS class
-
Collections can be arrays or ranges, and when a :collection is given the :select input will be rendered by default
-
define a to_label method on your model as Simple Form will search for and use :to_label as a :label_method first if it is found
-
configured with a default value to be used on the site through the SimpleForm.country_priority and SimpleForm.time_zone_priority helpers.
-
render a :select input for choosing the :company, and another :select input with :multiple option for the :roles
-
Simple Form will always look for a default attribute translation under the "defaults" key if no specific is found inside the model key
-
Simple Form will fallback to default human_attribute_name from Rails when no other translation is found for labels.
-
translations for labels, hints and placeholders for a namespaced model, e.g. Admin::User, should be placed under admin_user, not under admin/user
-
This difference exists because Simple Form relies on object_name provided by Rails' FormBuilder to determine the translation path for a given object instead of i18n_key from the object itself.
-
The HTML5 extensions include the new field types such as email, number, search, url, tel, and the new attributes such as required, autofocus, maxlength, min, max, step.
-
If you want to have all other HTML 5 features, such as the new field types, you can disable only the browser validation