Fix naming error

This commit is contained in:
Bernie Chiu 2013-09-17 12:02:35 +08:00
parent 0c29701f9b
commit e89615a6f3
4 changed files with 19 additions and 37 deletions

View File

@ -1,24 +0,0 @@
defaults: &defaults
host: localhost
# slaves:
# - host: slave1.local
port: 27017
# - host: slave2.local
# port: 27019
development:
<<: *defaults
database: test_site
test:
<<: *defaults
database: test_site
# set these environment variables on your prod server
production:
# host: <%= ENV['MONGOID_HOST'] %>
# port: <%= ENV['MONGOID_PORT'] %>
# username: <%= ENV['MONGOID_USERNAME'] %>
# password: <%= ENV['MONGOID_PASSWORD'] %>
# database: <%= ENV['MONGOID_DATABASE'] %>
<<: *defaults
database: test_site

View File

@ -53,6 +53,7 @@ class Panel::Ask::BackEnd::AskRepliesController < OrbitBackendController
'tax' => current_question.tax,
'content' => current_question.content,
}
request.set_form_data(body)
request.add_field 'X-Auth-Token', '3kjlfksjDFJ'
response = http.request(request)
@ -61,7 +62,7 @@ class Panel::Ask::BackEnd::AskRepliesController < OrbitBackendController
new_status = "轉介其他單位" + "(" + response.code + ")"
current_reply.update_attributes(status: new_status)
else
new_status = "轉介其他單位" + "(" + "success!" + ")"
new_status = "轉介其他單位" + "(" + " Success!" + ")"
current_reply.update_attributes(status: new_status)
end

View File

@ -7,11 +7,14 @@ class Panel::Ask::BackEnd::AskRequestsController < OrbitBackendController
def transfer_request
if request.headers["HTTP_X_AUTH_TOKEN"] == '3kjlfksjDFJ'
if !AskCategory.where(key: "transfered_question").any?
@ask_category = AskCategory.new(name: "transfered_question", key: "transfered_question")
if !AskCategory.where(key: "transferred_question").any?
@ask_category = AskCategory.new(key: "transferred_question")
@ask_category.name_translations = { "zh_tw" => "轉介的問題", "en" => "Transferred Question" }
@ask_category.save!
end
category = AskCategory.where(key: "transfered_question")
category = AskCategory.where(key: "transferred_question")
@transfered_question = AskQuestion.new(
name: params['name'],
identity: params['identity'],
@ -21,9 +24,11 @@ class Panel::Ask::BackEnd::AskRequestsController < OrbitBackendController
title: params['title'],
content: params['content'],
ask_category_id: category.first.id)
@transfered_question.ask_reply = AskReply.new
@transfered_question.ask_reply.update_attributes(status: "待處理 (轉)")
@transfered_question.save
render :nothing => true
else
render :status => 500

View File

@ -1,7 +1,7 @@
<script type="text/javascript">
$(document).ready(function() {
if ($("#ask_reply_status").val() == '轉介其他單位') { $('.dept_options').show(); }
// if ($("#ask_reply_status").val() == '轉介其他單位') { $('.dept_options').show(); }
$("#ask_reply_status").change(function() {