From 2ceba291bf2b3975ed748f21ca9839f6ddd57351 Mon Sep 17 00:00:00 2001 From: Tim Date: Thu, 8 Oct 2015 17:27:08 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=93=9D=E8=89=B2=E7=AE=AD=E5=A4=B4?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/images/course/arrow_up.jpg | Bin 18880 -> 19324 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/public/images/course/arrow_up.jpg b/public/images/course/arrow_up.jpg index 6bf285a1955654745423c78830c9d17ba422f707..bbf348fe1554afda8d34f08a5580060d312659f5 100644 GIT binary patch delta 1304 zcmX>wneopwMz;Sq{y!9$KauSouceitse++_m8r3niQ&YL%}o4~o68t$`RePIU(Gt0 zot^Fbv+SjtwP|sG=ih7fnjyzu?c7nmU4E_U)?XJgPo{q^dRxoQ|7_=cSLQ|ar+!xN zpY!KG!)|A9ROd)g$?( zx=a5tv!<$d{ZRd7@N;4OYt`SE@|Nt_TN`fwJ5oOB)7;tr8P5Oa`_J%~>&t(J2SLtF z^3U1+Gwjx#{O;+024mg*)$(WmnVHqFzAP*Z zARsQo7{$OWt?E8`j)087q^W-Gf?nxa>Md%25BLcOZ$2Rq!Mxc_M3&JRteSy|fd#CY z3C!h!2!cqkr~#PI$_N4w5nZqd8v`Sd=Gp8gx|Erh2dtC_B*AYwNm2|Huo9BF10JwO zBnK?RWC4u|CZV3myjn7wmuakF;xf9E9xXDn3)=ySsFT9Iy;(JxS5$c zJ32aA7@8WmSr}V7nwT3}ZeFOfomqj9v6DCGi=esYqJH4yR|ao03t)-E$|XO!G&eP` z#4#^9wYVg|sMt=yrYI%N$|*4&%F4;K13FJHB{Rj!z}UjT(9qn(z}(2d%)-#n!r9Qo z)dlD(OE(vw^Gt2@L0W+tAZ7p=ldW|$>M@032D%!%y16A~hd=jUQy=_&{}SzA!QZM1{xi7$+WzU6{ge91vvtG22fq8){yqL< zP5rf!UHtE#-~V^>pW%OokU#dXjO?v`)jwQ)Kls(W`GTik|M|-mQVPuam8buHKm6$V zj9u~X*{}Xfzw-R`>O)gM{AW1nzxZ$e%4hcSSNFfnJ^sb~r_Emd_<#JbZ2mL6c&&N) uKSNh>?)4w`d;T+2|7Y;6zfnKu^Iv;lc~ScBc=x{<{~0dblYe3V|0V!_KrBuG delta 884 zcmew}jq$)_Mz;Sq{y!9`n#gvK*VM|;NWs9;%D~jh)NJC%W+uKbo68t$`RaS_JPw}S z?_BG%+OFA#{r$~9Q`k~c6KvO29?*H}tQ^+h{h8izm;GM$jC3rFV4s> zP%zdrV6brV^krdT00I8VCk12#QpF~oJmv8%X4MK&{^nWklAFH@L@*05e*!DvVqo|W z2AkbQlo>Z~5?#Q|%LX=r2W*1CPqsiCv8p@D&mrQ75Top}ld_<`YOHQnvZgpInZE6#;*>1H`Y zJI2j1#y`dC+qSOVx~4NZWq!m}b@`nwC4qlFRcM?pe7yJkrAMz!W$b4B+9Wss{e*y5 zQp>tc3bT#6XKOcc#jjYtT)EU;{$%`y`_HD$a7%i;rTxPecbyNjPQL2d-~V&}#T2_O z_UHDe&ky`oKl|y7D>3g3??3y`@c+X5eF0B@xd%V>`gLr7#N)5;3Om33c>Cf%gIZcv zCI9#RcXyp-zp7vV@jpZTzw$4^Z Date: Thu, 8 Oct 2015 17:42:48 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=89=B9=E9=87=8F=E4=BF=AE=E6=94=B9tag?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/tags_controller.rb | 7 ++++--- app/views/files/_tag_yun.html.erb | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index 4f1a343d5..6b03cff1e 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -244,10 +244,11 @@ class TagsController < ApplicationController @taggings = ActsAsTaggableOn::Tagging.find_by_tag_id_and_taggable_id_and_taggable_type(@tag_id,@taggable_id,@taggable_type) unless @taggable_id.blank? @obj = get_object(@taggable_id,params[:taggableType]) unless @taggable_id.blank? if @taggable_id.blank? #如果没有传tag_id,那么直接更新tag_name就好了。但是要防止 重命名后的tag存在。 - #看重命名后的tag是否存在。如果存在的话,只需要更改taggings里边的id即可 + #看重命名后的tag是否存在。如果存在的话,只需要更改taggings里边的id, if @rename_tag - @taggings = ActsAsTaggableOn::Tagging.find_by_tag_id_and_taggable_type(@tag_id,@taggable_type) - @taggings.update_attributes({:tag_id=>@rename_tag.id}) + @taggings = ActsAsTaggableOn::Tagging.where(" `taggings`.`tag_id` = #{ @tag_id} AND `taggings`.`taggable_type` = 'Attachment' ")#find_by_tag_id_and_taggable_type(@tag_id,@taggable_type) + @taggings.each { |t| t.update_attributes({:tag_id=> @rename_tag.id}) if t.tag_id != @rename_tag.id } + ActsAsTaggableOn::Tag.find(@tag_id).update_attributes(:name=>@rename_tag_name)#并且将该tag改名 else #如果不存在,那么就直接更新该tag名称为新的名称 (ActsAsTaggableOn::Tag.find_by_name(@tag_name)).update_attributes(:name=>@rename_tag_name) end diff --git a/app/views/files/_tag_yun.html.erb b/app/views/files/_tag_yun.html.erb index 59b25c035..912d3b4f4 100644 --- a/app/views/files/_tag_yun.html.erb +++ b/app/views/files/_tag_yun.html.erb @@ -5,7 +5,7 @@ <%= k%>×<%= v%> <% else%> - <%= k%>×<%= v%> <% end%>