2011-08-04から1日間の記事一覧
ポイントは2つ ①子のモデルにaccepts_nested_attributes_forを定義 class Child belongs_to :parent accepts_nested_attributes_for :parent end ②fields_forで親のフィールドオブジェクトを生成する際に親のフィールドのname属性を自力で指定する。 親から…
ポイントは2つ ①子のモデルにaccepts_nested_attributes_forを定義 class Child belongs_to :parent accepts_nested_attributes_for :parent end ②fields_forで親のフィールドオブジェクトを生成する際に親のフィールドのname属性を自力で指定する。 親から…