title: Delete a key from every element in a JSON Array - Ruby
body: <p>So, I have a JSON array through which I am looping, and adding three keys and their values, I also want to remove/delete a key(subject_id) from every element in the array. </p>
  
  <p>How to go about doing this?</p>
  
  <pre><code>s=JSON.parse(subjects.to_json)
  s.each do |j|
    j["total_classes"] = total_classes[i]
    j["attended_classes"] = attended_classes[i]
    j["subject_name"] = subject_name[i]
    j["subject_id"] #remove this key, how?
    i=i+1
  end
  
  render json: { attendances: s }
  </code></pre>