How can I handle this type of multi level forms in rails
问题 I am in rails 3.1. I have the following models class Tool < ActiveRecord::Base has_many :comments end class Comment < ActiveRecord::Base belongs_to :tool has_many :relationships has_many :advantages, :through => :relationships, :source => :resource, :source_type => 'Advantage' has_many :disadvantages, :through => :relationships, :source => :resource, :source_type => 'Disadvantage' end class Relationship < ActiveRecord::Base belongs_to :comment belongs_to :resource, :polymorphic => true end