Ruby code:
<% if Setting.tag_visible? %> <% post.tags.each do |tag| %> <%= link_to tag.name, posts_path(tag: tag.name) %> <% end %> <% end %>
Html code:
<span class="label label-default">tag from db</span>
I tried:
<%= link_to(content_tag(:span, :class => 'label label-default')) tag.name, posts_path(tag: tag.name) %>
and also putting the content_tag section up after the post.tags.each but no joy. Most of the span examples or link_to with span examples don't use the post_path or aren't set up like mine. If anyone could shed some light, I'd be very grateful! Thanks in advance.