1

次のモデルを検討してください。

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 関係を定義するために存在します。

ありがとう!

ジョナサン

4

1 に答える 1

0

はい。結局のところ、ArtistEvent はさらに別のモデルであり、結合モデルにルートとコントローラーがある限り、アクティブなスキャフォールドを操作できます。

于 2011-01-21T10:02:31.220 に答える