Have a NESTED_ATTRIBUTES configuration to control what is being shown for HasOne relations
Created by: bo-oz
- What would you like to be able to do? Can you provide some examples?
On the show page of model A, I'd like to show details of model B (A has_one B). Currently administrate fetches the configuration from FORM_ATTRIBUTES
, I'd like to have more control by separating this definition into it's own configuration: NESTED_ATTRIBUTES
(for instance)
- How could we go about implementing that?
Probably some reconfiguration of the Field::HasOne
class
- Can you think of other approaches to the problem?
Create my own custom field to handle this, but it seems to be a valuable addition to the current solution. You could even overwrite NESTED_ATTRIBUTES = FORM_ATTRIBUTES
in the Administrate::BaseDashboard
for backwards compatibility.