From 060a2e225755aedc99a8cdbc5fae8296daa7a958 Mon Sep 17 00:00:00 2001 From: Aleksei Kvitinskii Date: Mon, 7 Nov 2011 13:40:22 +0200 Subject: [PATCH] move tag path to the appropriate helper --- app/helpers/tags_helper.rb | 5 +++++ app/views/projects/_list.html.haml | 2 +- app/views/tags/index.html.haml | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 app/helpers/tags_helper.rb diff --git a/app/helpers/tags_helper.rb b/app/helpers/tags_helper.rb new file mode 100644 index 00000000..1e82e34d --- /dev/null +++ b/app/helpers/tags_helper.rb @@ -0,0 +1,5 @@ +module TagsHelper + def tag_path tag + "/tags/#{tag}" + end +end diff --git a/app/views/projects/_list.html.haml b/app/views/projects/_list.html.haml index 7976b11f..89deb76d 100644 --- a/app/views/projects/_list.html.haml +++ b/app/views/projects/_list.html.haml @@ -14,7 +14,7 @@ = project.name .small-tags - project.tag_list.each do |tag| - = link_to tag, "/tags/#{tag}" + = link_to tag, tag_path(tag) %td= truncate project.url_to_repo %td= project.code diff --git a/app/views/tags/index.html.haml b/app/views/tags/index.html.haml index c83d62c7..ba16b92b 100644 --- a/app/views/tags/index.html.haml +++ b/app/views/tags/index.html.haml @@ -7,5 +7,5 @@ .tags-list - @tags.all.each do |tag| - = link_to "#{tag.name}(#{tag.count})", "/tags/#{tag.name}" + = link_to "#{tag.name}(#{tag.count})", tag_path(name)