Rails: link_to method

Posted by SuperString on Stack Overflow See other posts from Stack Overflow or by SuperString
Published on 2011-01-11T02:27:51Z Indexed on 2011/01/11 2:54 UTC
Read the original article Hit count: 146

Filed under:

I have something like this:

<p>
  <b>Tags:</b>
  <%if @post.tags.count > 0%>
    <%= @post.tags.collect {|c| (link_to c.name, c)}.join(", ")%>
  <%else%>
    Does not have any tags.
  <%end%>
</p>

Which gives me

Tags: <a href="/tags/1">Java</a>, <a href="/tags/2">CSS</a>

Instead of Java and CSS links. What am I missing?

© Stack Overflow or respective owner

Related posts about ruby-on-rails