From a8f930598fe3af49fc95e6336539e3a597936330 Mon Sep 17 00:00:00 2001 From: Jason Stumbaugh Date: Tue, 6 Aug 2019 09:42:09 -0500 Subject: [PATCH] Update documentation for including associated objects --- docs/3-index-pages/index-as-table.md | 7 +++++++ lib/active_admin/views/index_as_table.rb | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/docs/3-index-pages/index-as-table.md b/docs/3-index-pages/index-as-table.md index aa6ec3d8ebf..462573a9588 100644 --- a/docs/3-index-pages/index-as-table.md +++ b/docs/3-index-pages/index-as-table.md @@ -193,6 +193,13 @@ controller do end ``` +You can also define associated objects to include outside of the +`scoped_collection` method: + +```ruby +includes :publisher +``` + Then it's simple to sort by any Publisher attribute from within the index table: ```ruby diff --git a/lib/active_admin/views/index_as_table.rb b/lib/active_admin/views/index_as_table.rb index 52d0e365343..49e7570688b 100644 --- a/lib/active_admin/views/index_as_table.rb +++ b/lib/active_admin/views/index_as_table.rb @@ -192,6 +192,13 @@ module Views # end # ``` # + # You can also define associated objects to include outside of the + # `scoped_collection` method: + # + # ```ruby + # includes :publisher + # ``` + # # Then it's simple to sort by any Publisher attribute from within the index table: # # ```ruby