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 .
position
Item
Group
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 ?
item_group_memberships_controller
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
Source: https://habr.com/ru/post/1397329/More articles:Unwanted NSRegularExpression - regexHaskell's Where function type - typesEJB3 correlation identifier - javajava.lang.IllegalMonitorStateException: unlocking an unregistered monitor on java.util.Random.nextGaussian (Random.java:187) - androidSaving ABRecordRef in master data - core-dataRunning db.repairDatabase () from mongodb-native in node.js - javascriptgray drop-down box when selecting only one of the radio buttons - javascriptEclipse says a newer version of ADT is required but cannot find an update - androidCall custom functions from firebug console - javascriptC #: Why does generic type inference not work when there are several type arguments? - genericsAll Articles