简体   繁体   中英

Separating Facebook likes with a comma

I am using the koala gem within Ruby on Rails, and I am able to display the list of people that liked a post, but I would like to have them separated by a comma

- likes_list(feed['id'])[0,6].each do |like|
  = like['name'].to_sentence

above is what I have attempted to use without any success

You mean this? likes_list(feed['id'])[0,6].map{|u| u['name']}.join(',')

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM