---
title: "初学flex3和rails2的问题"
author: "engineer"
date: "2008-03-02T10:31:49Z"
tags: []
categories: ["编程语言"]
slug: "flex3-rails2"
draft: false
lastmod: "2008-03-02T10:31:49Z"
id: 166607
url: "https://engineer.iteye.com/blog/166607"
---

第一次写东西，请大家多多指教。
如题：总是提示如下错误：
发生ActionScript错误
［RPC Fault FaultString="HTTP request error" faultCode="Server.Error.Request" faultDetail="Error:.URL: http://localhost:3000/bugs/update"］    
at mx.rpc::AbstractInvoker/http://www.adobe:com/2006/flex/mx/internal::faultHandler()
at mx.rpc::Responder/fault()
at mx.rpc::AsyncRequest/fault()
at flash.events::EventDispatcherdispatchEventFunction()
at.flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/redirectEvent()

查看了一下，rails development/log,找到
/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/request_forgery_protection.rb这个文件，把其中的以下部分：
def verified_request?
        !protect_against_forgery?     ||
          request.method == :get      ||
          !verifiable_request_format? ||
          form_authenticity_token == params
      end
改写为：
def verified_request?
        !protect_against_forgery?     ||
          request.method == :post     ||
          request.method == :get      ||
          !verifiable_request_format? ||
          form_authenticity_token == params
      end

程序可正常运转。