On Jun 3, 8:47 pm, rdavila <ruben.grung...@gmail.com> wrote:
> Hi, I've a weird problem, I'm using Rails 3 with prototype 1.6.1 and I
> want to send my form via Ajax, when I set the ":remote => true" option
> in the form generator all works fine(It's handled by rails.js), but If
> I want to customize the request it fails with 406 error, I've checked
> the header with the Live HTTP Headers extension for Firefox and I saw
> that the "Accept" isn't set correctly:
> Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/
> *;q=0.8

What are you _expecting_ the `Accept` header to be? E.g., what's
incorrect about that one?

> Here is the JS code:
> document.observe("dom:loaded", function() {
>   $('new_user').observe('submit', function(){
>     new Ajax.Request('/users', {
>       parameters: this.serialize(),
>       asynchronous: true,
>       evalScripts: true,
>     });
>   });
> });

Slightly off-topic, but that code will fail in IE (you need to get rid
of the comma after `evalSdcripts: true`.

> I don't know why Prototype doesn't set the headers fine. I saw the
> source code ant it should be set this headers.
> Thanks.


T.J. Crowder
Independent Software Consultant
tj / crowder software / com

You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to