From a98af2f19aa0abbd65d09d448051671e5e2e8c6f Mon Sep 17 00:00:00 2001 From: albert Date: Tue, 5 Mar 2013 19:45:27 -0500 Subject: [PATCH] fix post set bug, fixes #768 --- app/controllers/posts_controller.rb | 2 +- app/logical/post_sets/post.rb | 2 +- app/views/posts/partials/show/_edit.html.erb | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb index 1d5b90744..af0935fcf 100644 --- a/app/controllers/posts_controller.rb +++ b/app/controllers/posts_controller.rb @@ -39,7 +39,7 @@ class PostsController < ApplicationController @error_message = @post.errors.full_messages.join("; ") render :template => "static/error", :status => 500 else - redirect_to post_path(@post) + redirect_to post_path(@post, :tags => params[:tags]) end end diff --git a/app/logical/post_sets/post.rb b/app/logical/post_sets/post.rb index 8bf487421..68b291a56 100644 --- a/app/logical/post_sets/post.rb +++ b/app/logical/post_sets/post.rb @@ -47,7 +47,7 @@ module PostSets end @posts ||= begin - ::Post.tag_match(tag_string).paginate(page, :count => ::Post.fast_count(tag_string), :limit => per_page) + temp = ::Post.tag_match(tag_string).paginate(page, :count => ::Post.fast_count(tag_string), :limit => per_page) temp.all temp end diff --git a/app/views/posts/partials/show/_edit.html.erb b/app/views/posts/partials/show/_edit.html.erb index 9d0cc5e86..4e4e574a0 100644 --- a/app/views/posts/partials/show/_edit.html.erb +++ b/app/views/posts/partials/show/_edit.html.erb @@ -5,6 +5,7 @@ <% end %> <%= form_for(post, :html => {:class => "simple_form", :id => "form"}) do |f| %> + <%= hidden_field_tag :tags, params[:tags] %> <%= f.hidden_field :old_tag_string, :value => post.tag_string %>