Reputation: 15069
I'm trying to do this in a view file:
<td><%= obj.user_ids.values.each {|user_id| link_to results_path(user_id)} %></td>
But it is displayed as the unchanged array. Why is this?
Upvotes: 0
Views: 247
Reputation: 26979
Alternately you might try collect
<%= obj.user_ids.values.collect {|user_id| link_to results_path(user_id)}.join %>
Upvotes: 0
Reputation: 7809
Try this:
<td>
<% obj.user_ids.values.each do |user_id| -%>
<%= link_to results_path(user_id) %>
<% end -%>
</td>
Upvotes: 2