Let\'s suppose that we have the following JSON Object that describes a Person:
{ \"firstName\": \"John\", \"lastName\": \"Smith\", \"age\": 25, \"address
just parse it and change it
hash = JSON.parse(json_data) hash["firstname"] = "John" hash.delete("lastname") new_json = hash.to_json
P.S. JSON.parse might not work - it depends on which JSON library you're using. try this instead:
ActiveSupport::JSON.decode(json_data)