Documentation suggestion for nested forms - HasOne

Open
#1,013 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
35/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Stale
Tech stack
rails, ruby
Domain
documentation

Research direction

Start with lib/administrate/field/has_one.rb at the linked line to confirm how nested-form parameters are supported. Find the relevant Administrate documentation and explain that the parent model needs has_one and accepts_nested_attributes_for; done when the setup is documented clearly for HasOne forms.

Written by the indexing model from the issue text.

Description

bug documentation good first issue

It would be useful to explain that in order to have a has_one association in a form, one has to add

  has_one :thing
  accepts_nested_attributes_for :thing

to the parent model. Saying this because the Field::HasOne already supports nested form and allows the params.

https://github.com/thoughtbot/administrate/blob/3366bd10a4afaf5bc0c63ea0f5ecc12b5d1bae31/lib/administrate/field/has_one.rb#L8

Dominant language
JavaScript
Stars
6k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from thoughtbot/administrate

All issues in thoughtbot/administrate

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.