Skip to content

Destroying nested forms #63

Answered by santib
andrewr224 asked this question in Q&A
Apr 22, 2021 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Hi @andrewr224, sorry for the late response. Currently, we don't have that feature. Thinking on the possibilities to implement it, I'm not sure what would be best:

  1. Make the save method smarter by using mark_for_destruction and the marked models gets deleted upon save.. The good thing is that it will allow creating + updating + deleting as part of the same form
  2. Have YAAF::Form have a destroy method which destroys everything in the @models array
  3. Have a new YAAF::DestroyForm which save method destroys everything in the @models array

Thoughts? cc @juanmanuelramallo

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@juanmanuelramallo
Comment options

Answer selected by andrewr224
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants