forms - Rails how to create recursive nested_form_for for child-parent relations -
model is
class menuitem < activerecord::base belongs_to :menu_item has_many :menu_items accepts_nested_attributes_for :menu_items end
how create form ability add dynamically children , children of children if needed (preferably nested_form_for). in other words form shall like:
input child input child input (child of child) add/remove child (child of child of child) add/remove child (child) add/remove input
clicking add/remove add/remove 1 more according child, how can achieve this?
cocoon should able handle use case fine. need experimenting since deep nesting non trivial.
Comments
Post a Comment