Vadym Kovalenko
Vadym Kovalenko

Reputation: 699

Rails Active Admin: How to display index page of one resource inside a show page of other resource?

In my Rails application I have, for an example, models Client and Service, with an association one to many. I've registered Client as a resource in active admin, but I don't want to create separate index page for Services. I want to be able to view services that belong to client at the client's show page, but I want services list look like as it would be displayed at the own index page: as table with sortable columns etc. Something like at the image below:

enter image description here

The client details part is rendered via partial.

Upvotes: 9

Views: 2188

Answers (1)

Piers C
Piers C

Reputation: 2978

The sorting functionality is provided by an Arbre component called IndexAsTable. Register the resource ClientService { belongs_to :client }

Upvotes: 0

Related Questions