From 2e253d00c39db6d5d4b0a303b6e9080a28460d1e Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 29 Oct 2014 09:52:33 +0800 Subject: [PATCH] =?UTF-8?q?#1333=E4=BF=AE=E5=A4=8Dcourse=E7=BD=91=E7=AB=99?= =?UTF-8?q?=E7=9A=84=E5=AF=B9=E4=BD=9C=E4=B8=9A=E7=95=99=E8=A8=80=E5=9B=9E?= =?UTF-8?q?=E5=A4=8D=E6=97=A0=E6=B3=95=E6=88=90=E5=8A=9F=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E7=9A=84BUg?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/words_controller.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/words_controller.rb b/app/controllers/words_controller.rb index e6ba74874..c6a5d2819 100644 --- a/app/controllers/words_controller.rb +++ b/app/controllers/words_controller.rb @@ -236,11 +236,10 @@ class WordsController < ApplicationController #modify by nwb #添加对课程留言的支持 referer = request.headers["Referer"] + #referer = "http://forge.trustie.net/words/create_reply" obj_id = referer.match(%r(/([0-9]{1,})(/|\?|$)))[1] if referer.match(/project/) obj = Project.find_by_id(obj_id) - elsif referer.match(/course/) - obj = Course.find_by_id(obj_id) elsif referer.match(/user/) obj = User.find_by_id(obj_id) elsif ( referer.match(/bids/) || referer.match(/calls/) ) @@ -251,6 +250,8 @@ class WordsController < ApplicationController obj = Softapplication.find_by_id(obj_id) elsif ( referer.match(/homework_attach/) || referer.match(/homework_attach/) ) #new added obj = HomeworkAttach.find_by_id(obj_id) + elsif referer.match(/course/) + obj = Course.find_by_id(obj_id) else raise "create reply obj unknow type.#{referer}" end