התייעצות כיצד להשיג מידע משתמשים

So that was enough? You might also also do something like

user_ids=user_data.pluck(:UserID)