vendredi 4 juin 2021

How to extract from an array of hash

people = [
    {id: 101, first_name: 'John', last_name: 'Doe'},
    {id: 102, first_name: 'Tom', last_name: 'Rogers'},
    {id: 103, first_name: 'Bill', last_name: ''}
]

I want to put a list of name like this, "John Doe, Tom Rogers, Bill"

How can i achieve this is in ruby?

Aucun commentaire:

Enregistrer un commentaire