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


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,
    });
  });
});

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.

-- 
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 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to