> Can somebody explain if this is just an error or wanted behaviour. We
> are facing big problems because of that.
Prototype (in some ways) follows conventions of the Ruby language
where Array and Hash aren't interchangeable. This is unlike PHP where
arrays are used as both.
In other words, your data should be either an array or hash.
We will still consider your issue, but in the meantime use the
following function in your scripts to override the original:
function $H(object) {
if (object) {
switch (object.constructor) {
case Hash: return object;
case Array:
var h = new Hash;
object.each(function(value, i){ h[i] = value });
return h;
}
}
return new Hash(object);
};
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" 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-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---