A Ruby form object library that decouples forms from models, providing validation, nesting, and composition.
Reform is a Ruby library that provides form objects decoupled from your models. It allows you to define forms with validations, nested structures, and compositions in a separate class, independent of your database or framework. It solves the problem of bloated models by moving form handling logic into dedicated form objects.
Ruby developers, especially those using Rails or other Ruby web frameworks, who need clean separation between form logic and models, and want to handle complex nested forms or multi-model compositions.
Developers choose Reform because it offers a simple, framework-agnostic API for form handling, supports nested forms and compositions out of the box, and integrates with validation backends like dry-validation, making forms more maintainable and testable.
Form objects decoupled from models.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Works with any Ruby framework and offers optional Rails integration via reform-rails, making it versatile for different environments as highlighted in the README.
Decouples form validations and logic from models into dedicated form objects, keeping models focused on persistence and reusable across contexts, aligning with the project's philosophy.
Handles nested forms and collections for has_one and has_many relationships through a simple API, enabling complex data structures without model bloat.
Allows composing forms from multiple models using the Composition feature, useful for aggregated data entry in single forms as documented.
Defines properties explicitly, eliminating the need for strong_parameters or attr_accessible and reducing security risks by ignoring undefined input.
Requires manual setup for validation backends like dry-validation and Rails integration via an additional gem, adding to setup time and complexity, as noted in the Installation section.
Full documentation is part of the Trailblazer site, and advanced features like populators are documented separately, making learning disjointed and less accessible.
Reform 2.2 introduced breaking changes such as not loading Rails files automatically, which can disrupt existing implementations and require updates.
Tightly integrated with the Trailblazer ecosystem, which might lead to vendor lock-in for complex use cases and require familiarity with additional gems.