-
Notifications
You must be signed in to change notification settings - Fork 506
_destroy doesn't work #27
Comments
That's strange, I'm not sure what the issue could be. Do you have attr_accessible in the image model? You can try adding You can check out the nested_form branch of the complex-form-example project for a working example. |
How can I debug "the model" to find the problem? I use the following in the parent model:
[SOLVED] Problem solved. I have moved the code above to the superclass. If the code is in the subclass model than the destroy doesn't work! |
Glad you got it solved, that's a strange bug but thank you for reporting. |
It might be good to mention in the readme the need for :allow_destroy => true in the accepts_nested_attributes_for call. |
Good point. I'll reopen this for that readme addition. |
i had the same problem in rails 3.1.0.rc8 - but to add :allow_destroy => true does the trick - also today in rails 3.1 … |
See pull request 88 for the readme update. |
#88 was merged. Thanks! |
Hi!
Good work Ryan!!! But something goes wrong in my project. I cannot destroy an image (I use carrierwave). If I click on "remove" the _destroy input tag is set to "1" but the image remains on save. Have you an idea? I have added "accepts_nested_attributes_for :assets, :allow_destroy => true" to the asset model and the other code is ok.
I use:
Rails 3.0.3
Ruby 1.9.2
Bye
The text was updated successfully, but these errors were encountered: