¡@

Home 

2014/10/16 ¤W¤È 12:08:20

jquery Programming Glossary: shared_items

Rails not decoding JSON from jQuery correctly (array becoming a hash with integer keys)

http://stackoverflow.com/questions/6410810/rails-not-decoding-json-from-jquery-correctly-array-becoming-a-hash-with-intege

array I can see that jQuery is doing its work correctly shared_items entity_id 253 position 1 entity_id 823 position 2 But if I just.. just send the array it as the data of the ajax call I get shared_items 0 entity_id 253 position 1 1 entity_id 823 position 2 Whereas.. position 2 Whereas if I just send a plain array it works shared_items entity_253 Why is Rails changing the array to that strange hash..

Rails not decoding JSON from jQuery correctly (array becoming a hash with integer keys)

http://stackoverflow.com/questions/6410810/rails-not-decoding-json-from-jquery-correctly-array-becoming-a-hash-with-intege

with jQuery to Rails I have this problem. If I stringify the array I can see that jQuery is doing its work correctly shared_items entity_id 253 position 1 entity_id 823 position 2 But if I just send the array it as the data of the ajax call I get shared_items.. entity_id 253 position 1 entity_id 823 position 2 But if I just send the array it as the data of the ajax call I get shared_items 0 entity_id 253 position 1 1 entity_id 823 position 2 Whereas if I just send a plain array it works shared_items entity_253.. I get shared_items 0 entity_id 253 position 1 1 entity_id 823 position 2 Whereas if I just send a plain array it works shared_items entity_253 Why is Rails changing the array to that strange hash The only reason that comes to mind is that Rails can't correctly..