Create a ressource with multiple relationships

The docs specifiy how to create a post -> comments relationship (so in the same direction as the has_many relationship But I couldn't find how to create a ressource that has multiple belongs_to With the post -> comments example, How would you create a comment that has more that one required relationship? Example: comment_created_by -> User comment_post -> Post comment_category (?) -> CommentCategory
Solution:
And write the ids. Or you can use the argument + manage_relationship pattern which you can see in the relationships guide
Jump to solution
3 Replies
ZachDaniel
ZachDaniel4mo ago
There are two ways You can make their ids writable
Solution
ZachDaniel
ZachDaniel4mo ago
And write the ids. Or you can use the argument + manage_relationship pattern which you can see in the relationships guide
Quentin
QuentinOP4mo ago
Thanks Zach !

Did you find this page helpful?