Alphabetize JSON object in ruby
Blog
Yeah, kitt finished writing this at 12:33 on 13 April 2015
... # 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