Correct Rails Path for Additional CRUD Attributes in the Link Table

I have an additional position attribute in my many-to-many link table. Its purpose is to determine the manually ordered position of an Item in a Group . The link model is called ItemGroupMembership .

I allow the user to edit this using jQuery UI sorting in a Backbone application.

What is the correct way to update this attribute. Am I treating the link table as a normal model and has item_group_memberships_controller ?

+4
source share
1 answer

How is an element assigned to groups in the first place? This should be done in item_group_memberships_controller .

So,

 class ItemGroupMembershipsController < Applicationontroller def create #create the relationship, passing in :position end def update #update the relationship by updating position end end 
0
source

Source: https://habr.com/ru/post/1397329/


All Articles