prettify tagsub names
This commit is contained in:
@@ -12,6 +12,10 @@ class TagSubscription < ActiveRecord::Base
|
||||
self.name = name.gsub(/\W/, "_")
|
||||
end
|
||||
|
||||
def pretty_name
|
||||
name.tr("_", " ")
|
||||
end
|
||||
|
||||
def initialize_creator
|
||||
self.creator_id = CurrentUser.id
|
||||
end
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
<table class="striped" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Creator</th>
|
||||
<th>Name</th>
|
||||
<th>Tag Query</th>
|
||||
<% if CurrentUser.is_admin? %>
|
||||
@@ -16,8 +15,7 @@
|
||||
<tbody>
|
||||
<% @tag_subscriptions.each do |tag_subscription| %>
|
||||
<tr>
|
||||
<td><%= link_to tag_subscription.creator.name, user_path(tag_subscription.creator_id) %></td>
|
||||
<td><%= tag_subscription.name %></td>
|
||||
<td><%= tag_subscription.pretty_name %></td>
|
||||
<td><%= tag_subscription.tag_query %></td>
|
||||
<td><%= tag_subscription.post_id_array.size %></td>
|
||||
<td>
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
<h2>Subscriptions</h2>
|
||||
<% @presenter.subscriptions.each do |subscription| %>
|
||||
<div class="box">
|
||||
<h3><%= link_to subscription.name, posts_path(:tags => "sub:#{@user.name}:#{subscription.name}") %></h3>
|
||||
<h3><%= link_to subscription.pretty_name, posts_path(:tags => "sub:#{@user.name}:#{subscription.name}") %></h3>
|
||||
|
||||
<div>
|
||||
<% @presenter.posts_for_subscription(subscription).each do |post| %>
|
||||
|
||||
Reference in New Issue
Block a user