views:

36

answers:

1

Hi folks,

I want to comma separate users.names using the handy rails to_sentence method.

Of course users.to_sentence isn't right # => #, #, #, # and #

It looks to me like I'll either have to create an array of the names to use this method on, or give up on using the method...

That said, I'm a total noob so you'll probably have some good advice.

Lay it on me.

Thanks

+3  A: 

Assuming you want to use the User#name method:

users.map(&:name).to_sentence
Simone Carletti
... Thank you! :-)
doctororange