I have a problem with associations. As a newbie to RoR, I've learned about associations from the guide on the RoR site. I have followed one of the example almost to the letter, the only thing being changed are the class names. The example being the following:
class Document < ActiveRecord::Base
has_many :sections
has_many :paragraphs, :through => :sections
end
class Section < ActiveRecord::Base
belongs_to :document
has_many :paragraphs
end
class Paragraph < ActiveRecord::Base
belongs_to :section
end
In my project, its Wizard, Page and Fields instead of Document, Section and Paragraph. In addition to following this example, I'm also using Typus as an admin interface. Everything appeared to be working fine. I created a wizard. Then created a page from the wizard section. Once I tried creating a field to be associated with a page it produced an error:
ActiveRecord::HasManyThroughCantAssociateThroughHasOneOrManyReflection in Admin/fieldsController#create
Cannot modify association 'Wizard#fields' because the source reflection class 'Field' is associated to 'Page' via :has_many.
. Unfortunately (and it may be my search terms) google doesn't seem to turn anything up that appears to be helpful to me. Does anyone have any advice on how to get this to work? Sorry in advance if I didn't state everything clearly.