|
|
|
@ -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
|
|
|
|
|