From 127c0874fcc307a143a292c63e8cf0fec9827069 Mon Sep 17 00:00:00 2001 From: albert Date: Fri, 22 Feb 2013 14:22:56 -0500 Subject: [PATCH] prettify tagsub names --- app/models/tag_subscription.rb | 4 ++++ app/views/tag_subscriptions/index.html.erb | 4 +--- app/views/users/show.html.erb | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/models/tag_subscription.rb b/app/models/tag_subscription.rb index 270b3774a..110f4e26c 100644 --- a/app/models/tag_subscription.rb +++ b/app/models/tag_subscription.rb @@ -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 diff --git a/app/views/tag_subscriptions/index.html.erb b/app/views/tag_subscriptions/index.html.erb index c91e11320..edef650fd 100644 --- a/app/views/tag_subscriptions/index.html.erb +++ b/app/views/tag_subscriptions/index.html.erb @@ -4,7 +4,6 @@ - <% if CurrentUser.is_admin? %> @@ -16,8 +15,7 @@ <% @tag_subscriptions.each do |tag_subscription| %> - - +
Creator Name Tag Query
<%= link_to tag_subscription.creator.name, user_path(tag_subscription.creator_id) %><%= tag_subscription.name %><%= tag_subscription.pretty_name %> <%= tag_subscription.tag_query %> <%= tag_subscription.post_id_array.size %> diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 2f80b6a7e..f8e18f5d9 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -34,7 +34,7 @@

Subscriptions

<% @presenter.subscriptions.each do |subscription| %>
-

<%= link_to subscription.name, posts_path(:tags => "sub:#{@user.name}:#{subscription.name}") %>

+

<%= link_to subscription.pretty_name, posts_path(:tags => "sub:#{@user.name}:#{subscription.name}") %>

<% @presenter.posts_for_subscription(subscription).each do |post| %>