sferik/rails_admin — Issue #954: Three level nesting?
Author: tylereaves
Created: 2012-02-01 21:07:33+00:00
State: open

I'm not sure what I'm after is possible.

I have 3 models,

Story has_many StoryImages, and accepts_nested_attributes_for
StoryImage belongs_to Credit, and accepts_nested_attributes_for
Credit has_many StoryImages

There is a "name" field on Credit, none of the other fields are relevant.

Inverse_of set on all relationships.

In rails_admin.rb, Credit has a parent of StoryImage, and StoryImage has a parent of Story.

If I go to the StoryImage, the nested Credit form shows up, and I can enter the name. Groovy.
If I go to a Story, the StoryImages controls show up, but NOT the Credit within each image.

Ideally, in the Story edit view, it'll behave like an inline field on the StoryImage, with the fact that it's actually a seperate model being essentially invisible to the user.

To throw a furthur wrinkle into this, I'd like to eventually give each Story a Credit also - basically the idea is that a Credit reprents a content creator, who can have several different types of content.