4

多対多リンクテーブルにposition属性が追加されています。その目的はGroupItemの手配位置を定義することです。リンクモデルはItemGroupMembershipと呼ばれます。リンクテーブルの余分な属性をCRUDする正しいレール方法

私はユーザーがこれをBackboneアプリケーションのjQuery UIソート可能オブジェクトで編集できるようにしています。

この属性を更新する正しい方法は何ですか。私はリンクテーブルを通常のモデルのように扱い、item_group_memberships_controllerを持っていますか?

答えて

0

最初にグループに割り当てられたアイテムはどのようになっていますか? これはitem_group_memberships_controllerで行う必要があります。

ので、

class ItemGroupMembershipsController < Applicationontroller 

def create 
    #create the relationship, passing in :position 
end 

def update 
    #update the relationship by updating position 
end 

end 
関連する問題