aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/blog/posts_controller.rb5
-rw-r--r--app/views/blog/shared/_post.html.erb2
-rw-r--r--app/views/blog/shared/_tags.html.erb2
3 files changed, 5 insertions, 4 deletions
diff --git a/app/controllers/blog/posts_controller.rb b/app/controllers/blog/posts_controller.rb
index 6b59867..4ea2e73 100644
--- a/app/controllers/blog/posts_controller.rb
+++ b/app/controllers/blog/posts_controller.rb
@@ -67,8 +67,9 @@ class Blog::PostsController < BlogController
end
def tagged
- @tag_name = params[:tag_name]
- @blog_posts = BlogPost.tagged_with(@tag_name.titleize).paginate({
+ @tag = ActsAsTaggableOn::Tag.find(params[:tag_id])
+ @tag_name = @tag.name
+ @blog_posts = BlogPost.tagged_with(@tag_name).paginate({
:page => params[:page],
:per_page => RefinerySetting.find_or_set(:blog_posts_per_page, 10)
})
diff --git a/app/views/blog/shared/_post.html.erb b/app/views/blog/shared/_post.html.erb
index e3ce714..00e5d23 100644
--- a/app/views/blog/shared/_post.html.erb
+++ b/app/views/blog/shared/_post.html.erb
@@ -15,7 +15,7 @@
<% if (tags = post.tag_list).any? %>
<aside class='tagged'>
<%= t('tagged', :scope => 'blog.posts.show') %>
- <%=raw tags.collect { |tag| link_to tag, tagged_posts_path(tag.parameterize) }.to_sentence %>
+ <%=raw tags.collect { |tag| link_to tag, tagged_posts_path(tag.id, tag.name.parameterize) }.to_sentence %>
</aside>
<% end %>
</section>
diff --git a/app/views/blog/shared/_tags.html.erb b/app/views/blog/shared/_tags.html.erb
index 140e60e..b0b11ee 100644
--- a/app/views/blog/shared/_tags.html.erb
+++ b/app/views/blog/shared/_tags.html.erb
@@ -2,7 +2,7 @@
<h2><%= t('.title') %></h2>
<nav id='tags'>
<% tag_cloud(@tags, %w(tag1 tag2 tag3 tag4)) do |tag, css_class| %>
- <%= link_to tag.name, tagged_posts_path(tag.name.parameterize), :class => css_class %>
+ <%= link_to tag.name, tagged_posts_path(tag.id, tag.name.parameterize), :class => css_class %>
<% end %>
</nav>
<% end %> \ No newline at end of file