Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • A administrate
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 96
    • Issues 96
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 32
    • Merge requests 32
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • thoughtbot, inc.
  • administrate
  • Issues
  • #440
Closed
Open
Issue created Jan 27, 2016 by Administrator@rootContributor

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:

https://github.com/thoughtbot/administrate/blob/master/app/views/fields/has_many/_show.html.erb#L22-L26

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 collection partial for Bravo, it will never be rendered for the bravos field.
  • If you have overridden the collection partial for Alpha, it will be used to render the bravos collection.

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.

Assignee
Assign to
Time tracking