From 53431bf0ad1173d268956f96361722207466a605 Mon Sep 17 00:00:00 2001 From: Nishant Upadhyay Date: Fri, 29 May 2015 00:13:45 +0530 Subject: [PATCH 1/2] Resolve bug in Tag Cloud --- app/helpers/links_helper.rb | 4 ++++ app/views/links/index.html.erb | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/helpers/links_helper.rb b/app/helpers/links_helper.rb index 0850696..27cbfef 100644 --- a/app/helpers/links_helper.rb +++ b/app/helpers/links_helper.rb @@ -48,4 +48,8 @@ def set_tooltip_on_count(number) def favourite_action_tooltip(link) "#{link.favourite? ? 'Unmark ' : 'Mark'} as Favourite" end + + def user_tags + current_user.owned_tags + end end diff --git a/app/views/links/index.html.erb b/app/views/links/index.html.erb index 7e5fd77..d741737 100644 --- a/app/views/links/index.html.erb +++ b/app/views/links/index.html.erb @@ -7,7 +7,7 @@ <%= render partial: 'links/links_list', locals: { links: @links}%>
- <% tag_cloud Link.tag_counts, %w{s m l} do |tag, css_class| %> + <% tag_cloud user_tags, %w{s m l} do |tag, css_class| %> <%= link_to tag.name, links_path(tag: tag.name), class: css_class %> <% end %>
From dbfbb9243c2fcfb6273207df48446a13bfe7d771 Mon Sep 17 00:00:00 2001 From: NishantUpadhyay-btc Date: Fri, 4 Dec 2015 09:10:10 +0530 Subject: [PATCH 2/2] Fix changes as per comments --- app/helpers/links_helper.rb | 4 ---- app/views/links/index.html.erb | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/app/helpers/links_helper.rb b/app/helpers/links_helper.rb index 27cbfef..0850696 100644 --- a/app/helpers/links_helper.rb +++ b/app/helpers/links_helper.rb @@ -48,8 +48,4 @@ def set_tooltip_on_count(number) def favourite_action_tooltip(link) "#{link.favourite? ? 'Unmark ' : 'Mark'} as Favourite" end - - def user_tags - current_user.owned_tags - end end diff --git a/app/views/links/index.html.erb b/app/views/links/index.html.erb index d741737..9548a81 100644 --- a/app/views/links/index.html.erb +++ b/app/views/links/index.html.erb @@ -7,7 +7,7 @@ <%= render partial: 'links/links_list', locals: { links: @links}%>
- <% tag_cloud user_tags, %w{s m l} do |tag, css_class| %> + <% tag_cloud current_user.owned_tags, %w{s m l} do |tag, css_class| %> <%= link_to tag.name, links_path(tag: tag.name), class: css_class %> <% end %>