When I use <%= f.datetime_select :somedate %> in a form, it generates HTML like:
<%= f.datetime_select :somedate %>
This is the method I use - it returns the deleted keys as a new hash.
class Hash def delete_by_keys(*keys) keys.each_with_object({}) { |k, h| h[k] = delete(k) if include? k } end end