From 7cbee4cd5379ff6f5195374bb4439ed5e7c50048 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Thu, 8 Oct 2015 14:11:54 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E8=BE=91tag=E6=9C=89=E6=97=B6?= =?UTF-8?q?=E5=80=99=E4=B8=8D=E8=83=BD=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/tags_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index 0ffa334c2..4f1a343d5 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -246,7 +246,7 @@ class TagsController < ApplicationController if @taggable_id.blank? #如果没有传tag_id,那么直接更新tag_name就好了。但是要防止 重命名后的tag存在。 #看重命名后的tag是否存在。如果存在的话,只需要更改taggings里边的id即可 if @rename_tag - @taggings = ActsAsTaggableOn::Tagging.find_by_tag_id_and_taggable_type(@tag_id,@taggable_id,@taggable_type) + @taggings = ActsAsTaggableOn::Tagging.find_by_tag_id_and_taggable_type(@tag_id,@taggable_type) @taggings.update_attributes({:tag_id=>@rename_tag.id}) else #如果不存在,那么就直接更新该tag名称为新的名称 (ActsAsTaggableOn::Tag.find_by_name(@tag_name)).update_attributes(:name=>@rename_tag_name)