Sorry, that ajax.request method should be a put, so:
new Ajax.Request('/appointments/array/',
{method:'post',postBody:"'data='+myArray.toJSON"});
On Sep 8, 2:52 pm, David <[EMAIL PROTECTED]> wrote:
> Hey can anyone help me convert a javascript array into a ruby array.
> Ive been struggling with this since friday to no avail. This is the
> function with the ajax.request call that is supposed to convert the
> array using JSON, but I keep getting a 422(Unprocessable Entity)
> error. Im not sure what is wrong.
>
> function test()
> {
> for(i=1;i<22;i++){
> if (document.getElementById(i+'d').className ==
> "selected"){
> myArray.push(i);
> }
> }
>
> new Ajax.Request('/appointments/array/',
> {method:'get',postBody:"'data='+myArray.toJSON"});
>
> }
>
> Thanks for any input!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---