# nathanvda/cocoon

Dynamic nested forms using jQuery made easy; works with formtastic, simple_form or default forms

Repository: https://github.com/nathanvda/cocoon
Canonical: https://ross.abutalabs.com/products/cocoon
Homepage: http://github.com/nathanvda/cocoon
Language: Ruby
License: MIT
License Family: permissive
Last push: 2023-08-08T14:11:26+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 5684, "days_push": 1121, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 3072, forks 376 (observed 2026-08-28T04:07:41.634423+00:00)

## What it is
A Ruby gem for Ruby on Rails that simplifies building dynamic nested forms, allowing users to add and remove nested model fields (e.g., tasks within a project) via jQuery. It is form builder-agnostic and works with standard Rails forms, Formtastic, and SimpleForm.

## Use cases
- add nested form fields dynamically in rails
- invoice with line items form rails
- project with tasks nested attributes form
- add and remove nested model fields with jquery
- nested forms with simple_form or formtastic
- accepts_nested_attributes_for dynamic form

## When to choose
- You have a Rails app already using jQuery and need dynamic nested forms
- You use Formtastic or SimpleForm and want builder-agnostic nested form support
- You need add/remove links for nested models like line items or tasks

## When to avoid
- You use a modern JavaScript framework like React or Vue for forms
- You want a jQuery-free solution (vanilla alternatives exist on npm)
- You are starting a new Rails 7+ project without jQuery

## Facets
- artifact type: library
- maturity: maintenance
- function: form-handling, ui-components
- domain: web-development, frontend
- platform: ruby, browser
- tags: rails, nested-forms, jquery, formtastic, simple-form, ruby-gem, web-server

## Member repositories
- nathanvda/cocoon (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:41.634423+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T07:27:58.755407+00:00, confidence not recorded.
  - readme: https://github.com/nathanvda/cocoon (fetched 2026-08-28T04:07:41.634423+00:00, sha 725a4a372f1c)
  - homepage: http://github.com/nathanvda/cocoon (fetched 2026-08-29T09:43:14.956177+00:00, sha b66b291add56)
- Data as of 2026-08-30T08:39:29.467469+00:00.
