railsadminteam / rails_admin

RailsAdmin is a Rails engine that provides an easy-to-use interface for managing your data
MIT License
7.9k stars 2.26k forks source link

Expose and document how to get the nested-parents' attributes #3517

Open tosbourn opened 2 years ago

tosbourn commented 2 years ago

When using accepts_nested_attributes_for to help streamline adding multiple related models it would often be of benefit to be able to limit some options based on the "parent" model.

Following the guidance in the wiki you can scope associations at the point of edit. But what about when you're making a new version of a nested object.

In this case it would be amazing to have access to binding[:parent] (bad name) to allow us to scope attributes based on the parent object, if set.

I've looked through the wiki and the codebase and couldn't see how this could be done, but presumably if I'm in an edit view it should be possible?