I have a call like this:
<%= product.categories.map{|cat| cat.name}.join(', ').to_s + "." %>
What I would like to do, is something like this:
<%= product.categories.map{|cat| link_to cat.name, category_path(cat)}.join(', ').to_s + "." %>
When I do that, it actually spits out the path /categories/1 as text and doesn’t actually make it a link.
How do I generate the actual link within this block?
Thanks.
Edit: Anyone have any ideas about how to do this?
I need to wrap the entire
mapresult inrawlike this:For a more full answer, check here.