由于某些原因,我不能让has_many/ cannot _ to关系工作。嵌套的内容类型不会显示在父级中。这就是我所拥有的:
app/content_type/news_Phoos.yml
- article:
label: News articles
type: belongs_to
target: news_articlesapp/content_types/news_articles.yml
- news_photos:
label: News photos
type: has_many
target: news_photos
class_name: news_photos
inverse_of: news_article
required: false
hint: A description of the field for the editors
localized: false
ui_enabled: true谢谢你的帮助!
发布于 2015-12-27 07:09:39
我不确定您是否找到了解决方案,但实际上问题出在命名上。has_many定义应具有inverse_of: article
inverse_of的值应该是在其他模型中具有belongs_to关系的属性的名称,在本例中为news_photos。
https://stackoverflow.com/questions/21272788
复制相似问题