colorize tags in popular searches

This commit is contained in:
r888888888
2015-10-28 13:59:15 -07:00
parent 8f71e0cd0b
commit 6bbc957cdb
2 changed files with 10 additions and 1 deletions

View File

@@ -9,6 +9,15 @@ class TagSubscription < ActiveRecord::Base
validate :validate_number_of_queries
validate :creator_can_create_subscriptions, :on => :create
def migrate_to_saved_searches
tag_query.split(/\r\n|\r|\n/).each do |query|
creator.saved_searches.create(
:tag_query => query,
:category => name
)
end
end
def normalize_name
self.name = name.gsub(/\s+/, "_")
end

View File

@@ -11,7 +11,7 @@
</thead>
<tbody>
<% @search_service.each_search do |tags, count| %>
<tr>
<tr class="category-#{Tag.category_for(tags)}">
<td><%= link_to tags, posts_path(:tags => tags) %></td>
<td style="text-align: right;"><%= count.to_i %></td>
</tr>