Use join to construct tag strings instead of mucking around counting
position in the string.
This commit is contained in:
parent
9afb533280
commit
0b6f0c1d34
2 changed files with 2 additions and 6 deletions
|
@ -27,9 +27,7 @@
|
|||
<%= t'trace.trace.by' %> <%=link_to h(trace.user.display_name), {:controller => 'user', :action => 'view', :display_name => trace.user.display_name} %>
|
||||
<% if !trace.tags.empty? %>
|
||||
<%= t'trace.trace.in' %>
|
||||
<% trace.tags.each_with_index do |tag, index| %>
|
||||
<%= link_to_tag tag.tag %><%=', ' if index+1 < trace.tags.count %>
|
||||
<% end %>
|
||||
<%= trace.tags.collect { |tag| link_to_tag tag.tag }.join(", ") %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -36,9 +36,7 @@
|
|||
<td><%= t'trace.view.tags' %></td>
|
||||
<td>
|
||||
<% unless @trace.tags.empty? %>
|
||||
<% @trace.tags.each_with_index do |tag, index| %>
|
||||
<%= link_to tag.tag, { :controller => 'trace', :action => 'list', :tag => tag.tag, :id => nil } %><%=', ' if index+1 < @trace.tags.count %>
|
||||
<% end %>
|
||||
<%= @trace.tags.collect { |tag| link_to tag.tag, { :controller => 'trace', :action => 'list', :tag => tag.tag, :id => nil } }.join(", ") %>
|
||||
<% else %>
|
||||
<i><%= t'trace.view.none' %></i>
|
||||
<% end %>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue