Search code examples
ruby-on-railscssacts-as-taggable-onacts-as-taggable

Style tag_list class from Acts as Taggable On


I'm undoubtedly missing something obvious, but how should I style the output of individual tags produced by <%= user.tag_list %>?

<%= user.tag_list, :class => 'tags' %> doesn't work...

Note, I want to style the individual results, not the whole block.

Thanks!


Solution

  • This should do the trick:

    <% user.tag_list.each do |tag| %>
      <span class="tags"><%= tag %></span>
    <% end %>