PierreW
2009-Nov-24 08:29 UTC
has_and_belongs_to_many relationship in nested forms - follow up
(sorry if it appears twice, it''s a repost - didn''t go through the first time) Hi guys, I have seen several older posts on this subject, but none with a real answer... Now that 2.3 is a few months old, does someone know what the status is for nested forms and habtm relationship? It seems the two blocking points are: 1) Deleting the association instead of destroying a record. In the alloy-complex-form-example (my understanding is it is the "official" example), we have: class Project < ActiveRecord::Base has_and_belongs_to_many :tags end If you edit a "Project" and "remove" a specific "Tag", it destroys the Tag record itself instead of only the link in the join table. It is not the right behaviour, is it? 2) Creating an association instead of a record. With the same example, there doesn''t seem to be a way to associate an existing Tag to a Project (it always creates a new Tag, or does nothing if you pass the id). Thanks for your help! -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.