and javascript code
function filter_this(myInput, codes) {
for(var i=0;i<codes.length;i++) {
var myid = codes[i].attributes;
var filter_divs = 'div' + myid.id;
document.getElementById(filter_divs);
}
}
This code works perfectly in local but in server it says myid has no
properties.
I suggest you examine the generated JSON. Firebug also has a
javascript debugger you can see what is going on (I suspect the
problem is that codes[i] does not have an attributes property. The
difference is probably that in production you have a newer version of
rails than in development - newer versions of rails add a to_json
method to activerecord objects that just dump the attributes)