How do you display all entries of a user's children?

I’m building a test application where admin users have sub-users. Now, I
want to let the admin user see all entries of their sub-users.

For instance, I tried: “current_user.children.entries” (where
current_user is the admin user), but I’m getting an undefined method.

What’s the correct syntax to do it?

Bob S. wrote:

I’m building a test application where admin users have sub-users. Now, I
want to let the admin user see all entries of their sub-users.

For instance, I tried: “current_user.children.entries” (where
current_user is the admin user), but I’m getting an undefined method.

What’s the correct syntax to do it?

nevermind, I got it with:

current_user.children.collect(&:entries).flatten

:slight_smile: