You can just loop through the results of the method poll_winners
<% poll_winners.each do |pw| %>
<%= pw %>
<% end %>
You can then get a specific attribute of Post
, for example if it has a title
you can just do <%= pw.title %>
instead of just <%= pw %>
which will return the object.
I am assuming that the method is as follows
def poll_winners
@posts = Post.tally(
:at_least => 1,
:limit => 20,
:order => 'vote_count desc'
})
end