Rails FormBuilder plugin that generates accessible HTML forms with inferred inputs, associations, I18n, and customizable field lists.
Overview
Formtastic is a Rails FormBuilder DSL for producing semantic, accessible HTML forms. It focuses on readable form definitions instead of verbose ERB for each field.
It understands ActiveRecord associations, rendering selects or radio groups for belongs_to and multi-selects for has_many relations. Inputs infer types from columns but allow explicit :as options, hints, legends, and required flags.
Internationalization hooks read labels from Rails I18n or Formtastic-specific keys, and semantic_errors surfaces validation messages per attribute or on :base.
Developers can register custom inputs by generating input classes under app/inputs, extending existing types, or building entirely new renderers.
Key features
- Association-aware select inputs
- Inferred column input types
- Custom input class generators
- I18n label and hint lookups
- Fieldset legends and hints
- Nested form support
- HTML5 input type coverage
- Semantic error display helper
Use cases
- Rapid Rails admin-style forms
- Accessible public signup flows
- Localized multi-step Rails forms
- Custom field widgets in Rails