ajax-datatables-rails
ajax-datatables-rails copied to clipboard
A way to search without filtering
trafficstars
So I have a Group model, which has many-to-many-through with UserGroup1 and UserGroup2, and are displayed in the same row like this:
However, if I search for one of the users in a Group, the other users in that group disappears. Here I searched for tom:

Here is the view_columns def:
@view_columns ||= {
number: { source: 'Group.number', cond: :eq },
usergroup1: { source: 'UserGroup1.netID' },
usergroup2: { source: 'UserGroup2.netID' },
sync_id: { source: 'Group.sync_id', cond: :eq },
dt_action: { searchable: false }
}
and here is the get raw records:
Group.all.includes(usergroup1: :department, usergroup2: :department).references(:usergroup1, :usergroup2)
Just wondering if there is a way I can search for my Groups without it filtering out the individual users in that group?