Ruby on rails 如何将表单数据调用为xml表单

Ruby on rails 如何将表单数据调用为xml表单,ruby-on-rails,Ruby On Rails,您好,我正在处理一些web应用程序,在将输入表单值保存到数据库之前,首先将其传递到xml表单。但当我传递以下数据时,它不起作用。这样做对吗 <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="ht

您好,我正在处理一些web应用程序,在将输入表单值保存到数据库之前,首先将其传递到xml表单。但当我传递以下数据时,它不起作用。这样做对吗

<?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Body>
        <PostTransaction xmlns="http://PegPayTelecomsApi/">
          <trans>
            <DigitalSignature>de96d901b3bad1db2aab76b7b0b202f2</DigitalSignature>
            <FromTelecom>#{params[:pay_type]}</FromTelecom>
            <ToTelecom>#{params[:pay_type]}</ToTelecom>
            <PaymentCode>1</PaymentCode>
            <VendorCode>TEST</VendorCode>
            <Password>61T05DB750</Password>
            <PaymentDate>01/01/2014</PaymentDate>
            <Telecom></Telecom>
            <CustomerRef>#{params[:phone_no]}</CustomerRef>
            <CustomerName>#{params[:name]}</CustomerName>
            <TranAmount>10000</TranAmount>
            <TranCharge>0</TranCharge>
            <VendorTranId>1</VendorTranId>
            <ToAccount></ToAccount>
            <FromAccount>#{params[:phone_no]}</FromAccount>
            <TranType>PULL</TranType>
          </trans>
        </PostTransaction>
      </soap:Body>
    </soap:Envelope>

de96d901b3bad1db2aab76b7b0b202f2
#{params[:pay_type]}
#{params[:pay_type]}
1.
测验
61T05DB750
01/01/2014
#{params[:电话号码]}
#{params[:name]}
10000
0
1.
#{params[:电话号码]}
拉

什么是“它不工作”,任何异常或提示都表明它不工作。如何将参数传递到xml部分?我只想知道这是否是将参数从ruby表单传递到xml表单的正确方法。然后介绍如何自动捕获该格式中的日期将此xml作为部分xml,并使用render_as_string使其更易于维护。这就是我所做的以及它现在的工作方式。“+“#{@order.pay_type}”+“”+Date.today.strftime(“%m/%d/%Y”)+”。等