I have a User class and a GroupUser class. I’m trying to do a search by name of the users. I tried following what I read on the joins, but I have something wrong. Also I need to change my name portion of the query to a like instead of an equals
Here is the query I had initially built.
@users = GroupUser.joins(:users).where(:group_id => params[:group_id]).where(:users => {:name => params[:q]})
Try this: