Commit 0d77f8f8c36fe7745638a3ef17ed76bb148d2359
1 parent
15e48e28
Exists in
master
and in
27 other branches
profile-suggestions: wrap tag connections in block; max is 4
(ActionItem3234)
Showing
1 changed file
with
2 additions
and
1 deletions
Show diff stats
app/helpers/application_helper.rb
@@ -1428,11 +1428,12 @@ module ApplicationHelper | @@ -1428,11 +1428,12 @@ module ApplicationHelper | ||
1428 | end | 1428 | end |
1429 | 1429 | ||
1430 | def profile_suggestion_tag_connections(suggestion) | 1430 | def profile_suggestion_tag_connections(suggestion) |
1431 | - tags = suggestion.tag_connections.map do |tag| | 1431 | + tags = suggestion.tag_connections.first(4).map do |tag| |
1432 | tag.name + ', ' | 1432 | tag.name + ', ' |
1433 | end | 1433 | end |
1434 | last_tag = tags.pop | 1434 | last_tag = tags.pop |
1435 | tags << last_tag.strip.chop if last_tag.present? | 1435 | tags << last_tag.strip.chop if last_tag.present? |
1436 | + tags << '...' if suggestion.tag_connections.count > 4 | ||
1436 | content_tag(:p, tags.join) | 1437 | content_tag(:p, tags.join) |
1437 | end | 1438 | end |
1438 | end | 1439 | end |