Scaffold problem...

In your abc model:

has_and_belongs_to_many :xyz

In your xyx model:

has_and_belongs_to_many :abc

Is this what you were asking?