문제

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!

도움이 되었습니까?

해결책

This should do the trick:

<% user.tag_list.each do |tag| %>
  <span class="tags"><%= tag %></span>
<% end %>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top