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
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
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.

Colin

>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/2707c91a-bda1-4c6e-a378-59b8eee96d89%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages