The full range of relevant code is here.
My problem is, I am trying to rebuild something from Railscast 196, to get multiple nested forms in my form for Campaign. Every Campaign can have one or more teams attached to it, via CampaignTeam. Also, the Campaign is dependent on a client, without it, it can’t exist.
# config/routes.rb
resources :clients do
resources :campaigns
end
Now, with the above code (I didn’t want to clutter this question with it), I get an error: Can't mass-assign protected attributes: campaign_team. When I add attr_accessible :campaign_team then I get unknown attribute: campaign_team.
How can I get rails to finally eat this form and just nest an Array of CampaignTeam with a single member? Where am I doing wrong here?
(Sorry been at this single form for three hours now and very frustrated)
I have solved the problem. In the controller, I changed in the controller
and then changed the
new.html.hamlline 15 toNot it works fine.