Skip to content

feat: choose the fields shown for each relationship on the show page - #446

Merged
zachdaniel merged 1 commit into
ash-project:mainfrom
rum-and-code:feat/show-relationship-fields
Nov 11, 2026
Merged

zachdaniel merged 1 commit into
ash-project:mainfrom
rum-and-code:feat/show-relationship-fields

Conversation

@etiennelacoursiere

Copy link
Copy Markdown
Contributor

Sometime i don't want the full attributes list of a relationship in the admin UI so i added a show_relationship_fields option on the admin dsl., keyed by relationship name. The listed attributes render in the given order, both in the has_many table and in the has_one/belongs_to grid. Unlisted relationships still show every attribute.

admin do
  show_relationship_fields organizations: [:name]
end

I'm not sure about the naming of the option.

Contributor checklist

Leave anything that you believe does not apply unchecked.

  • I accept the AI Policy, or AI was not used in the creation of this PR.
  • Bug fixes include regression tests
  • Chores
  • Documentation changes
  • Features include unit/acceptance tests
  • Refactoring
  • Update dependencies

Add the `show_relationship_fields` admin option, keyed by relationship
name, e.g. `show_relationship_fields organizations: [:name]`. The listed
attributes render in the given order, both in the has_many table and in
the has_one/belongs_to grid. Unlisted relationships show every attribute.

A verifier rejects unknown relationships and fields that are not
attributes of the destination resource.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zachdaniel
zachdaniel merged commit 82ea7f3 into ash-project:main Nov 11, 2026
26 checks passed
@zachdaniel

Copy link
Copy Markdown
Contributor

🚀 Thank you for your contribution! 🚀

@etiennelacoursiere
etiennelacoursiere deleted the feat/show-relationship-fields branch November 11, 2026 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants