thoughtbot/administrate

Documentation suggestion for nested forms - HasOne

Ouverte

#1 013 ouverte le 25 oct. 2017

 (2 commentaires) (0 réaction) (0 personne assignée)Ruby (1 110 forks)batch import
bugdocumentationgood first issue

Métriques du dépôt

Stars
 (5 765 étoiles)
Métriques de merge PR
 (Métriques PR en attente)

Description

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

Guide contributeur