Has many field renders (potentially) wrong partial
Created by: keithlayne
If a dashboard has one or more has_many fields, then on that dashboard's show page the collection partial will be rendered for each has_many field:
The problem has to do with the template lookup path. Take for example a class Alpha that has many Bravos. On the Alpha show page, the collection partial will be rendered for each relation:
- If you have overridden the
collectionpartial forBravo, it will never be rendered for thebravosfield. - If you have overridden the
collectionpartial forAlpha, it will be used to render thebravoscollection.
Neither of these seem to be the intended behavior. It would be easy to create a test exposing this bug. I have successfully gotten my desired behavior by putting an ugly hack in app/views/fields/has_many/_show.html.erb.
It seems likely that similar bugs exist in this project in other places - I can't confirm or deny that right now. It seems like to really fix this there needs to be support for resolving the correct administrate partial regardless of the view context while respecting template inheritance.