기존 파괴 할 수 없습니다. 내 _linked_source_fields 부분에서 나는 link_to_remove_association을 가지고 있으며 "_destroy"입력 값을 "1"로 설정하여 제대로 작동합니다.내가 세 가지 모델이 중첩 협회
utf8:✓
_method:put
authenticity_token:726c1e7NIb0Je2uUZYeKLXmqgFHxgakfcF6fzpjFb38=
answer[theme_id]:2
answer[body]:retert
_wysihtml5_mode:1
answer[question_id]:22
answer[linked_sources_attributes][0][source_id]:3
answer[linked_sources_attributes][0][nested]:
answer[linked_sources_attributes][0][source_attributes][source_type]:book
answer[linked_sources_attributes][0][source_attributes][title]:erger
answer[linked_sources_attributes][0][source_attributes][id]:3
answer[linked_sources_attributes][0][description]:erger ter
answer[linked_sources_attributes][0][_destroy]:1
answer[linked_sources_attributes][0][id]:3
answer[linked_sources_attributes][1][source_id]:4
answer[linked_sources_attributes][1][nested]:
answer[linked_sources_attributes][1][source_attributes][source_type]:film
answer[linked_sources_attributes][1][source_attributes][title]:terter
answer[linked_sources_attributes][1][source_attributes][id]:4
answer[linked_sources_attributes][1][description]:retr
answer[linked_sources_attributes][1][_destroy]:1
answer[linked_sources_attributes][1][id]:4
commit:Готово
을 그리고 그 정확한 데이터 것 같다 :
내가 버튼을 제출이 자원을 제거하고 눌러
, 나는 다음과 같은 형태로 데이터를 보내고받을.그러나이 양식을 저장 한 후에는 linked_sources가 모두 존재합니다. 서버 측은 단지 "_destroy"매개 변수를 무시합니다.
무엇이 잘못 되었나요? 나는이 프로젝트에서 더 단순한 중첩 (단 하나의 레벨)을 가진 다른 모델을위한 또 다른 누에 고치 형태를 가지고있다. 그리고 그것은 잘 작동하지만, 다른 경우에는 그렇지 않다.
은 (당신이 알 수 있듯이, 제 영어는 완벽하지 않습니다 - 미안 - 당신이 그것을 수정 있을지 괜찮을 것)