I have the following for each statement:
<% @post.votes.each do |vote| %>
<span class='voted-user'>
<%= link_to vote.user.username, vote.user %>
</span>
<% end %>
I want to have the usernames like this:
username1, username2, username3, and username4 using the to_sentence method.
But I’m not sure how to use it in this case. Any suggestions?
Although I would suggest just moving it all into a helper.
view
<%= vote_links @post.votes %>votes_helper.rb