colorize tags in popular searches
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user