Commit 0d77f8f8c36fe7745638a3ef17ed76bb148d2359

Authored by Larissa Reis
1 parent 15e48e28

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 1428 end
1429 1429  
1430 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 1432 tag.name + ', '
1433 1433 end
1434 1434 last_tag = tags.pop
1435 1435 tags << last_tag.strip.chop if last_tag.present?
  1436 + tags << '...' if suggestion.tag_connections.count > 4
1436 1437 content_tag(:p, tags.join)
1437 1438 end
1438 1439 end
... ...