I'm using Ransack and will_paginate on an Oracle view to fetch records to generate an array of hashes for DataTables.
@users = User.search(params[:q]).result.page(params[:page]).per_page(params[:per_page])
There's no primary key so my display currently looks like:
John | Doe | 123
-----------------------
John | Doe | 456
-----------------------
Jane | Doe | 123
-----------------------
Ideally, I'd like to be display it like this:
John | Doe | 123, 456
------------------------------
Jane | Doe | 123
------------------------------
I'm curious how people would go about doing this.
Can I use distinct on the Ransack result, paginate it to reduce my record set, do a left join on User to get the rows removed by distinct... and then what?