This code should do it:
follower.pursuit_list.map { |p| link_to p.name.titleize, "#" }.join(', ').html_safe
It implies that the PursuitList object responds to the name
method, which I consider as the Tag's name in this code.
Frage
I have this code that outputs a list of users' interests and I can't figure out how to titleize each tag of the list.
<%= raw follower.pursuit_list.map { |p| link_to p, "#" }.join(', ') %>
Lösung
This code should do it:
follower.pursuit_list.map { |p| link_to p.name.titleize, "#" }.join(', ').html_safe
It implies that the PursuitList object responds to the name
method, which I consider as the Tag's name in this code.