I’m trying to debug a problem where Rails isn’t decoding the JSON POST data.
The server logs show:
2011-12-14T06:44:44+00:00 app[web.2]: Started POST
2011-12-14T06:44:44+00:00 app[web.2]: Processing by PostsController#create as */*
2011-12-14T06:44:44+00:00 app[web.2]: Parameters: {"{\"athlete_id\":\"\",\"known_as\":\"abc\",\"email\":\"abc@defg.com\",\"result\":\"112233\",\"rx\":false,\"mods\":\"thkjth\",\"notes\":\"\"}"=>nil, "affiliate_id"=>"testaffiliate", "wod_id"=>"12345"}
Note that the JSON string is not being parsed – Rails is assigning it as a key in the hash, pointing to a nil value. Does anyone have any ideas before I write a before_filter that tries to JSON.parse all of the params keys?
I don’t think this is relevant since I’m sending and receiving data okay, but this problem occurs during a CORS Request from IE (using XDomainRequest).
For Thin:
For Unicorn and Phusion Passenger: