次のモデルを検討してください。
class Artist < ActiveRecord::Base
has_many :artist_events
has_many :events, :through => :artist_events
end
class Event < ActiveRecord::Base
has_many :artist_events
has_many :artists, :through => :artist_events, :order => 'artist_events.position'
end
class ArtistEvent < ActiveRecord::Base
default_scope :order => 'position'
belongs_to :artist
belongs_to :event
acts_as_list :scope => :artist
end
このタイプの関係を管理するために ActiveScaffold を使用することは可能ですか? ArtistEvent モデルは、位置の追加属性を使用して hbtm 関係を定義するために存在します。
ありがとう!
ジョナサン