2014-01-22 2 views
2

어떤 이유로 나는 has_many/belongs_to 관계가 작동하지 않습니다. 중첩 된 콘텐츠 형식이 부모에 표시되지 않습니다. 도움을LocomotiveCMS has_many/belongs_to not working

응용 프로그램/CONTENT_TYPES/news_photos.yml

- article: 
    label: News articles 
    type: belongs_to 
    target: news_articles 

응용 프로그램/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 

감사 : 여기에 내가 무엇을 가지고!

+0

명명 규칙에서 실수로 보입니다. 자습서에서 일부 생성기 예제를 시도해보고 비교해보십시오. –

답변

0

해결책을 찾았는지 확실하지 않지만 문제는 실제로 이름을 지정하는 것입니다. has_many 정의 inverse_of: article

inverse_of 값이 경우 news_photos 다른 모델에서 belongs_to 관계를 갖는 속성의 이름이어야 가져야한다.