From 0d77f8f8c36fe7745638a3ef17ed76bb148d2359 Mon Sep 17 00:00:00 2001 From: Larissa Reis Date: Tue, 12 Aug 2014 16:46:43 -0300 Subject: [PATCH] profile-suggestions: wrap tag connections in block; max is 4 --- app/helpers/application_helper.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 9a155a6..add0f94 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1428,11 +1428,12 @@ module ApplicationHelper end def profile_suggestion_tag_connections(suggestion) - tags = suggestion.tag_connections.map do |tag| + tags = suggestion.tag_connections.first(4).map do |tag| tag.name + ', ' end last_tag = tags.pop tags << last_tag.strip.chop if last_tag.present? + tags << '...' if suggestion.tag_connections.count > 4 content_tag(:p, tags.join) end end -- libgit2 0.21.2