Rails complaining about {:method=>:get} on an AJAX call

Hello guys,

I hope you can point me in the right direction. I just moved to Rails 2.0 and I'm having some problems. I'm using ExtJS (excellent widget library btw), to make my application.

Right now I'm testing a login form that I'm developing for a web application, the login form sends the info throught AJAX.

I get a 404 error from the server, it complains that the method used to pass the values was GET, but I'm pretty sure it was a POST, here is the firebug error: -> POST http://localhost:3000/session/404 (313ms)

And this is what firebug report in the [Headers | Post | Response]:

[Post]

I'm using ExtJS as I said, and it abstracts the AJAX calling. Here is the code for the form:

This is the code of the form: [CODE] var submitUrl = '/session';

var formPanel = new Ext.form.FormPanel({             baseCls: 'x-plain',                         method: 'post',             baseParams: {               module: 'login'             },             bodyStyle: 'background:#f9f9f9 none; color:#222; padding:5px 35px;',             defaults: {               width: 200             },             defaultType: 'textfield',             frame: false,             height: 70,             id: 'login-form',             items: [{                 fieldLabel: 'Nombre de usuario',                 name: 'login',                 value: 'usuario'             },{                 fieldLabel: 'Contraseña',                 inputType: 'password',                 name: 'password',                 value: 'contraseña'             },{                             inputType: 'hidden',                             name: Ext.get('authenticity_token').dom.getAttribute('name'),                             hidden: true,                             value: Ext.get('authenticity_token').dom.getAttribute('value')

                        }],             labelWidth:120,             region: 'south',             url: submitUrl         }); [/CODE]

Or can I get the info you want from firebug? if so, if you tell me I can get it for you.

Yeah, what I'm trying to understand is why would my POST parameters end like a GET string, if Firebug is clearly showing a POST.

If I understand why that happens, I might be able to correct the error.

Shame on me, it was a problem with the Rails app, it was doing a redirect to another page in the method that was invoked in the AJAX call.

I think that explains why I was getting my POST params as a GET string.

Well at least I hope this can help someone with my same problem :wink: