From de56206045814618a9e38bb284c2ffea7846e4ce Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 14 Mar 2016 14:34:35 +0100 Subject: [PATCH] Deliver objects with associations in index list (like it is on show). --- app/controllers/application_controller.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index cd24f1a39..97595bfd6 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -378,7 +378,11 @@ class ApplicationController < ActionController::Base def model_index_render (object, _params) generic_objects = object.all - model_index_render_result(generic_objects) + generic_objects_with_associations = [] + generic_objects.each {|item| + generic_objects_with_associations.push item.attributes_with_associations + } + model_index_render_result(generic_objects_with_associations) rescue => e logger.error e.message logger.error e.backtrace.inspect