app/helpers/tags_helper.rb
# Generate tag links for use on asset index pages.
#----------------------------------------------------------------------------
Generate tag links for use on asset index pages.
Generate tag links for use on asset index pages .
def tags_for_index(model)
    model.tag_list.inject([]) do |arr, tag|
      query = controller.send(:current_query) || ""
      hashtag = "##{tag}"
      if query.empty?
        query = hashtag
      elsif !query.include?(hashtag)
        query += " #{hashtag}"
      end
      arr << link_to_function(tag, "crm.search_tagged('#{query}', '#{model.class.to_s.tableize}')", :title => tag)
    end.join(" ").html_safe
  end
def tags_for_index ( model ) model . tag_list . inject ( [ ] ) do | arr , tag | query = controller . send ( :current_query ) || "" hashtag = "##{tag}" if query . empty? query = hashtag elsif ! query . include? ( hashtag ) query += " #{hashtag}" end arr << link_to_function ( tag , "crm.search_tagged('#{query}', '#{model.class.to_s.tableize}')" , :title => tag ) end . join ( " " ) . html_safe end
Generate tag links for use on asset index pages.
Generate tag links for use on asset index pages .
model
<not_specific>