("no success" is too vague. You need to show the specific results or
error messages you're getting. Otherwise, we need to break out the
Assuming you have the tables set up correctly (you need a groups_users
join table), your problem is that current_user.groups doesn't have a
tasks method. It's a collection of Group rows, each of which would
have a tasks method.
You need to iterate over the groups:
all_tasks = current_user.groups.collect(&:tasks).flatten