Hans Marmolin
2009-Aug-01 16:42 UTC
Nested forms and deleting/removing has_many associations
I am using nested forms on person model that has many pictures. I would like to allow the user to remove on or more of the associated pictures from the person using nested forms as suggested by Ryan Bates. However delete will delete the picture not remove the associatioon I can do it in the controller, but it should be done in the same way as delete is performed using attribute _delete Anyone knowing if a _remove attribute is implemented or know any other way to solve the problem (e.g. that could be a command allow_remove=true) Another problem is that it seems as nested forms do not validate the attributes of the associated object in this case picture. I have solved the problem by a fix in the controller, but it should really be a part the nested form Anyone that has a solution to that problem? Any comment would be much appreciated -- Posted via http://www.ruby-forum.com/.
Seemingly Similar Threads
- Nested Forms with has_many associations with validations
- nested has_many associations
- Problem saving nested attributes for has_many associations (Rails 2.3 RC2 and Edge)
- rails 2.3 nested forms with has_many through checkboxes
- Using form_for and has_many associations with a controller in its own subdirectory