Hi,

If I have two m:m models - posts and tags.

How I do update their association automatically?

Right now I am doing something like this:

@post.comments.intermediaries.destroy
params[:comment_ids].each do |id|
  @post.comments << Comment.get(id.to_i)
end
@post.save

Note: "params[:comment_ids]" is collected via check boxes.

Which means that, I need to wipe the existing association and
reconstruct it. I don't think it's very intuitive. Am I missing
something here?

-- 
You received this message because you are subscribed to the Google Groups 
"DataMapper" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/datamapper?hl=en.

Reply via email to