A Rails gem for dynamically adding and removing nested forms using jQuery, compatible with Formtastic, SimpleForm, and default forms.
Dynamic nested forms using jQuery made easy; works with formtastic, simple_form or default forms
Automatically handles adding and removing nested fields without page reloads, as shown in the basic usage examples with tasks and projects.
Works seamlessly with Rails' default forms, Formtastic, and SimpleForm, making it versatile for different form-building preferences.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Offers data attributes to control where and how new fields are inserted, providing flexibility in form layout, as detailed in the Control the Insertion Behaviour section.
Includes events like cocoon:before-insert for custom logic and supports object wrapping with decorators via the wrap_object option, enhancing interactivity and code organization.
Relies on jQuery, which can be a limitation for modern Rails projects using Webpacker or other JavaScript frameworks, as noted in the prerequisites.
For Rails 6/Webpacker, installation requires adding both a gem and a companion npm package, which adds steps compared to older Rails versions.
Has issues like the need for force_non_association_create in has_one associations and careful handling of _destroy and id parameters, as highlighted in the Strong Parameters and Has One Gotcha sections.