Given something like the following models:

a.rb
class A < ActiveRecord::Base
  has_many :abcs
end

b.rb
class B < ActiveRecord::Base
  has_many :abcs
  has_many :cs, :through => :abcs
end

c.rb
class C < ActiveRecord::Base
  has_many :abcs
  has_many :bs, :through => :abcs
end

abc.rb
class ABC < ActiveRecord::Base
  belongs_to :a
  belongs_to :b
  belongs_to :c
end

All four classes have AS-controllers etc.

The objects in classes B and C are mostly constant, so I wont normally
create those objects new, but take them from the database. Class A is
the lead class, so lets assume I am about to create one object of
class A. I have to attach a list of B-classed objects and a list of C-
classed objects and practically all combinations of those two lists
via ABC.

So far I used a non-AS controller for creating A. I created two
render_components (one for B and one for C) and the AS mark-feature to
create the wanted combinations and attach them to the new A-classed
object.

My question (wow, that took long): Is there a way to simplify the
creation by using Volkers batch_create? How would I do this?

Regards
Michael








Regards
Michael

-- 
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.

Reply via email to