# Rails 2.3.2 Ajax posting to XML

**URL:** <https://www.ruby-forum.com/t/rails-2-3-2-ajax-posting-to-xml/164853>\
**Category:** Rails\
**Created:** [April 6, 2009, 5:40pm UTC](https://www.ruby-forum.com/t/rails-2-3-2-ajax-posting-to-xml/164853 "2009-04-06T17:40:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sjames](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c57346/32.png) [@sjames](https://www.ruby-forum.com/u/sjames)\
**Post date:** [April 6, 2009, 5:40pm UTC](https://www.ruby-forum.com/t/rails-2-3-2-ajax-posting-to-xml/164853/1 "2009-04-06T17:40:56Z")

</div>

I believe this might have already been discussed but i have recently  
been thrown an application that was written for rails 1.2.6, and i have  
been given the task to upgrade it (please note that im super to new to  
ruby as well, but we can’t really do anything about that)

basically the pervious person was doing an ajax call using  
“path/to5.xml?\_method=delete”

and then posting, however with 2.3.2, this is no longer allowed?

What would be the best way to alleviate this situation?  
thanks alot!

---

<div class="post-metadata">

**Author:** ![sjames](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c57346/32.png) [@sjames](https://www.ruby-forum.com/u/sjames)\
**Post date:** [April 6, 2009, 6:37pm UTC](https://www.ruby-forum.com/t/rails-2-3-2-ajax-posting-to-xml/164853/2 "2009-04-06T18:37:21Z")

</div>

> basically the pervious person was doing an ajax call using  
> “path/to5.xml?\_method=delete”
> 
> and then posting, however with 2.3.2, this is no longer allowed?

You might try posting the \_method parameter instead of including it in  
the querystring.

## SH

Starr H.  
Check out my Helpdesk RailsKit: [http://railskits.com/helpdesk/](http://railskits.com/helpdesk/)

---

<div class="post-metadata">

**Author:** ![sjames](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c57346/32.png) [@sjames](https://www.ruby-forum.com/u/sjames)\
**Post date:** [April 6, 2009, 10:33pm UTC](https://www.ruby-forum.com/t/rails-2-3-2-ajax-posting-to-xml/164853/3 "2009-04-06T22:33:07Z")

</div>

On Apr 6, 4:40 pm, James H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> I believe this might have already been discussed but i have recently  
> been thrown an application that was written for rails 1.2.6, and i have  
> been given the task to upgrade it (please note that im super to new to  
> ruby as well, but we can’t really do anything about that)
> 
> basically the pervious person was doing an ajax call using  
> “path/to5.xml?\_method=delete”
> 
> and then posting, however with 2.3.2, this is no longer allowed?

What’s happening when you do this ? I do vaguely recall a change where  
the requests that were exempt from csrf protection changed:

[https://rails.lighthouseapp.com/projects/8994/tickets/73-security-bug-request-forgery-protection-checks-for-accept-header-instead-of-content-type-header](https://rails.lighthouseapp.com/projects/8994/tickets/73-security-bug-request-forgery-protection-checks-for-accept-header-instead-of-content-type-header)  
[https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/1145-bug-invalidauthenticitytoken-incorrectly-raised-for-xml-controllerdestroy-request](https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/1145-bug-invalidauthenticitytoken-incorrectly-raised-for-xml-controllerdestroy-request)

Fred

---

<div class="post-metadata">

**Author:** ![sjames](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c57346/32.png) [@sjames](https://www.ruby-forum.com/u/sjames)\
**Post date:** [April 7, 2009, 9:33am UTC](https://www.ruby-forum.com/t/rails-2-3-2-ajax-posting-to-xml/164853/4 "2009-04-07T09:33:50Z")

</div>

I write code use flex3 from rails2.2 to rails2.3.And i got the same  
question  
with you.

Rails2.3 do not accept GET params from url.  
You may try the other ways by the HTTP Headers. I dnot know if you can  
change the headers for Ajax.  
X\_HTTP\_METHOD\_OVERRIDE=“PUT”
