I have one CarrierWave Uploader called documents .
Three Models:
I currently have ActiveAdmin setup: app/admin/document.rb
belongs_to :university
That works well, however, when I try adding another belongs_to :webinar_content association, I get the following error:
Couldn't find University with 'id'=
Any idea on how to resolve this?
Without seeing your schema, its hard to tell. Though I suspect you want polymorphic associations.
Basically you want your document to belongs_to :documentable
having a documentable_id
and a documentable_type
on the Document
model.
Then on your other models you wish to upload documents to you have has_many :documents
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.