From 0b6f0c1d34f636c0cdde234f3a62a6ead2b8655f Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Tue, 7 Jul 2009 23:05:35 +0000 Subject: [PATCH] Use join to construct tag strings instead of mucking around counting position in the string. --- app/views/trace/_trace.html.erb | 4 +--- app/views/trace/view.html.erb | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/app/views/trace/_trace.html.erb b/app/views/trace/_trace.html.erb index d38fa2f4c..4cd40352a 100644 --- a/app/views/trace/_trace.html.erb +++ b/app/views/trace/_trace.html.erb @@ -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 %> diff --git a/app/views/trace/view.html.erb b/app/views/trace/view.html.erb index 1001cadf9..4ab46bd3e 100644 --- a/app/views/trace/view.html.erb +++ b/app/views/trace/view.html.erb @@ -36,9 +36,7 @@ <%= t'trace.view.tags' %> <% 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 %> <%= t'trace.view.none' %> <% end %> -- 2.39.5