Here is my code, I’m trying to display a list of links to a bboy’s crews in sentence form with .to_sentence
<span class="affiliation">
<% if(@bboy.crews.count > 0)%>
<span><%= if(@bboy.crews.size > 1) then "Crew".pluralize else "Crew" end %>:</span>
<%= @bboy.crews.collect{|c| link_to c.name, c}.to_sentence %>
<% else %>
<em>Independent</em>
<% end %>
</span>
The output I get is the correct links but it displays as:
<a href="/crews/1">Hustle Kidz</a> and <a href="/crews/2">Knuckleheads Cali</a>
rather than:
with the html escaped, rather than the desired links.
Am I missing something? I’ve tried CGI.unescapeHTML and a few others but am getting lost…
I agree with Kleber S, you should move this into a helper, because that’s a lot of logic for a view
and in your view: