Module: TagsHelper

Included in:
Api::V1::UsersController
Defined in:
app/helpers/tags_helper.rb

Instance Method Summary collapse

Instance Method Details


4
5
6
7
8
9
# File 'app/helpers/tags_helper.rb', line 4

def looking_for_tag_link
  return if search_query.include?('@') || normalize_tag_name(search_query).blank?
  ('small') do
    t('people.index.looking_for', tag_link: tag_link(search_query)).html_safe
  end
end

#normalize_tag_name(tag) ⇒ Object


11
12
13
# File 'app/helpers/tags_helper.rb', line 11

def normalize_tag_name(tag)
  ActsAsTaggableOn::Tag.normalize(tag.to_s)
end

15
16
17
# File 'app/helpers/tags_helper.rb', line 15

def tag_link(tag)
  link_to("##{tag}", tag_path(name: normalize_tag_name(tag)))
end