rails associations using build_association and create_association helpers
29 views
Skip to first unread message
fugee ohu
unread,
Jan 7, 2016, 6:32:40 AM1/7/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ruby on Rails: Talk
I have users has_one profile, profiles has_many schools, schools has_many teams I'm trying to write the new and create actions for the teams controller i'm not sure what they should be, i have something like @team= current_user.profile.build_team(team_params) which i've been trying different variations of
Colin Law
unread,
Jan 7, 2016, 11:35:45 AM1/7/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ruby on Rails: Talk
You are making the same mistake you did before. You cannot use
profile.build_team because there is not an appropriate relation
between profile and team.