Deleting subform plural association last record #195

Closed
vtt opened this Issue Mar 19, 2012 · 8 comments

Projects

None yet

2 participants

@vtt

Hi,

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

@vhochstein
Owner

Do you use prototype or jquery?

@vtt

I am using JQuery

@vhochstein
Owner

Have you already done an analysis why this is failing?

@vtt

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
end

@vtt

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.

@vhochstein
Owner

Yes, you are right! Will have to think about how to fix this...

@vhochstein
Owner

I hope I ve fixed this issue with my last commit.
Can you please check?

@vtt

Thanks for fixing this. The problem has been resolved.

@vtt vtt closed this Mar 30, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment