Use @ variables; @test_results and @notes to render a loop of  instances of that variable from a partial (_test_result or _note) instead of a .each do block.
Add @logs in test_results controller. sorts @test_results + @notes together by created_at date. Paginate with Kaminari.paginate(wrapper) for arrays instead of active record items.