Hi, so I am attempting to gather a number of onclicks from the user
with a javascript function and store them in an array. The problem is
that I now want to be able to take that array and covnert it into ruby
so that I can perform further functions on it and save it in the
database. This is the function that I have so far: I am using JSON
and trying to pass the array in an ajax.request call but it is not
routing to the /appointments/array/ action. Is this the right way to
go about it?
function test()
{
for(i=1;i<22;i++){
if
(document.getElementById(i+''d'').className
="selected"){
myArray.push(i);
}
}
new Ajax.Request(''/appointments/array/'',
{method:''post'',postBody:''data=''+myArray.toJSON});
}
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---