* Refactored tag fix code

* Revert quick search open in new window behavior
This commit is contained in:
albert
2013-03-18 09:13:39 -07:00
parent a48ea51f55
commit 177baa9ec7
8 changed files with 93 additions and 10 deletions

View File

@@ -2,15 +2,15 @@ class TagCorrectionsController < ApplicationController
before_filter :member_only
def new
@tag = Tag.find(params[:tag_id])
@correction = TagCorrection.new(params[:tag_id])
end
def create
if params[:commit] == "Fix"
@tag = Tag.find(params[:tag_id])
@tag.delay.fix_post_count
@correction = TagCorrection.new(params[:tag_id])
@correction.fix!
end
redirect_to tags_path(:search => {:name_matches => @tag.name})
redirect_to tags_path(:search => {:name_matches => @correction.tag.name}), :notice => "Tag will be fixed in a few seconds"
end
end