I’m a newbie…
I know how to use “to_sentence” when I have something like:
<%= @blah.collect {|b| b.name}.to_sentence %>
but what if I have a more complex block like:
<% skill.position.each do |position| %>
<a href="<%= position.company.url %>"><%= position.company.name %></a>
<% if position.salary? %>
<span><%= position.salary %></span>
<% end %>
<% end %>
The desired output is:
Microsoft, Google 2000, and Yahoo.
Couldn’t you just collect it without .each?
That should work for you…
You could also do this: