I want to add a link to each element of an array, then join the resulting array. I tried:
myarray.collect{|u| link_to u[:first_name], username_path(u[:username])}.join(', ')
This does everything correctly, except it returns:
<a href="/niels">Niels Bohr</a>, <a href="/richard">Richard Feynman</a>
Instead of
<a href="/niels">Niels Bohr</a>, <a href="/richard">Richard Feynman</a>
How do I fix this? Or is there a simpler way of proceeding?
Thanks.
Use
html_safe