Search code examples
ruby-on-railsarrayskoala

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


Solution

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