I have two models, links and tags, associated through a third, link_tags. The following code is in my Link model.
Associations:
class Link < Acti
In order for this to work, you need to pass in the right params hash:
params = {
:link => {
:tags_attributes => [
{:tag_one_attr => ...}, {:tag_two_attr => ...}
],
:link_attr => ...
}
}
And your controller will look like:
def create
@link = Link.create(params[:link]) # this will automatically build the rest for your
end