I am having trouble deleting the last record of a plural association in subform edit view.
Deleting the association records in subform edit view works fine as long as there is at least 1 remaining association record.
The "X" delete button removes the record from the view, but when clicking "Update", the last record is not removed.
This problem exists in branch 'rails 3.0' active_scaffold_vho 3.0.25
Do you use prototype or jquery?
I am using JQuery
Have you already done an analysis why this is failing?
Yes, the reason for it to fail is because I set "show_blank_record = false". You can verify this with your "howto" application for Rails 3.0 and add the below code to the Team controller. Add two players to the same team, and try to remove the last player from the team edit view.
ActiveScaffold.set_defaults do | config |
ActiveScaffold::DataStructures::Column.show_blank_record = false
If "show_blank_record = true", then everything works correctly. So there's a problem with removing associated records in subforms edit view when this setting is set to false.
Yes, you are right! Will have to think about how to fix this...
I hope I ve fixed this issue with my last commit.
Can you please check?
Thanks for fixing this. The problem has been resolved.