Alphabetize JSON object in ruby
Blog
Instead of being asleep at 12:33 on 13 April 2015, kitt created this:
... # ActiveSupport = a rails thing... json objects are Hashes json_object = ActiveSupport::JSON.decode(request.body) # look! comments in code! json_object = Hash[json_object.keys.sort.map {|k| [k, json_object[k]]}] ...
Add new comment