There's an echo in my head

日々のメモ。

actioncontroller

accepts_nested_attributes_forを多段で使う

複数の関連を跨いでaccepts_nested_attributes_forを使う場合の話。 たとえば Organization has_many Groups Group has_many Employees というモデルに対して、1度にまとめてこれらのレコードを作成したい場合には次のようにする。 まずはクラスの定義: clas…

このブログに出てくるコードスニペッツは、引用あるいは断りがない限りMITライセンスです。